Previous payment transactions are missing

#1

When I view payments (subscription management >> payment >> records), I see only 1 transaction and cannot see the rest of the transactions. There are multiple journals, but this error only shows up on 1 of the journal.

The is the error message I see, which is a link say the following:

Fatal error: Call to a member function getUsername() on a non-object in /xxxx/xxxxx/public_html/cache/t_compile/%%24^249^2499BF4E%%viewPayments.tpl.php on line 62

When I click the error, it says the following: Sorry, the requested user does not exist.

Nothing have been done the website. I am inclined to think it is a bug.

I really do not know whats happening. Any help will be appreciated.

0 Likes

#2

Hi @newone,

Yes, it seems it’s a bug. The payment is still referring to an user that’s already not in the system anymore. Can you try something to fix it?

Please, manually edit the templates/payments/viewPayments.tpl file, replacing this code:

{if $isJournalManager}
     <a class="action" href="{url op="userProfile" path=$payment->getUserId()}">{$user->getUsername()|escape|wordwrap:15:" ":true}</a>
{else}
     {$user->getUsername()|escape|wordwrap:15:" ":true}
{/if}

by this:

 {if $user}
     {if $isJournalManager}
             <a class="action" href="{url op="userProfile" path=$payment->getUserId()}">{$user->getUsername()|escape|wordwrap:15:" ":true}</a>
        {else}
             {$user->getUsername()|escape|wordwrap:15:" ":true}
     {/if}
 {/if}

The original code starts at line 54, and goes until 58. Can you test with that modification and see if the page works fine?

Thanks,
Bruno

1 Like

#3

Hi Bruno,

Thanks for that! I can see the transactions again.

In Subscription >> Payments >> Records, I noticed that in the “User” or username column, 5 of the transactions were empty. I dug a bit deeper but 2 of the users were removed. They were removed through the Merge Users function, and their role was assigned to the website manager. As for the other 3, their account are still active.

When you click “details” in the Payment >> Records, I see the following error:

Fatal error: Call to a member function getUsername() on a non-object in /xxxx/xxxx/public_html/cache/t_compile/%%0A^0A5^0A577DEB%%viewPayment.tpl.php on line 46

How come removing a user is creating this problem?

What would be good is to have a way for users to view what they downloaded or subscribed to previously. You can see your current subscription, but not the history. That would be helpful, if a feature is available.

1 Like

#4

@newone,

I looked at the merge users code, and I didn’t find anything moving the queued or completed payments from one user to another. I am not sure about it yet, but I think that’s a bug. I created this issue: https://github.com/pkp/pkp-lib/issues/705

Thanks for your help and stay tuned on that issue to follow any update.

Cheers,
Bruno

2 Likes

#5

I did not get a notification there was an update.

By removing, I meant that those users, who at one point paid to access an article, are no longer part of the website.

Is there any resolution to the issue? Will this be address in the next release update of OJS?

0 Likes

#6

@newone,

One of the fixes to your database I can think of would be to apply an SQL query to remove all the payment information that’s related to a non existing user. You will not be able to assign the payment information to the original user you used to merge the deleted user, since OJS doesn’t keep track of the merge history. Would this be a problem?

Thanks,
Bruno

1 Like

#7

Thanks for your kind offer. I just saw this as I come with another issue.

I have no problem with removing the SQL query to remove payment of non-existing user.

What is the SQL statement to use to do that?

Thanks

0 Likes

#8

Deal all,
I have the same error:
PHP Fatal error: Call to a member function getUsername() on a non-object in
while updating OJS 3.0.2 to 3.1.01 in SubmissionFile.inc.php on line 643.

It might be because of information of a submission id that related to deleted author?

Would you please help me
Thanks

0 Likes

#9

Hi @MJB,

I see you’ve also posted this on another thread. Please don’t double-post – it clutters the forum.

Regards,
Alec Smecher
Public Knowledge Project Team

0 Likes