Various OJS 3.1.2 errors on attempting to subscribe (after composer update)

This is about a new install of OJS 3.1.2.0. with Bootstrap 3 (latest, May 2019)

After Error 500 (blank screen) on a subscribing attempt was resolved with the composer update of symfony-guzzle dependencies (as recommended in another question), another error is returned: “A transaction error occurred. Please contact the journal manager for details.” In yet another question, this was resolved by entering correct PayPal REST API Live credentials. But here, all PayPal REST API credentials are correct.

Error log reports warnings only, and ends with a strange entry preceded by neither Error nor Warning label: “PayPal transaction exception: String is not a valid decimal number” for which Google returns only 1 search result, tracing the entry to Omnipay. The entry is returned regardless if there are webhooks set up in PayPal REST API or not.

Trying to purchase an Institutional subscription still returns Error 500 (blank screen) though. This triggers an error in the error_log:

“PHP Fatal error: Uncaught → Smarty Compiler: Syntax error in template “app:app:frontendpagespurchaseInst” on line 23 “{assign var=“formPath” value={“institutional”:to_array:$subscriptionId}}” - Unexpected “:”, expected one of: “}” ← thrown in /home/…/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 23” The lines 22 and 23 of smarty_internal_templatecompilerbase.php contain only:

22 abstract class Smarty_Internal_TemplateCompilerBase

23 {

NOTE: Bootstrap3 update v3.1.2.5 released on 2019-05-01 as Compatibility release for OJS 3.1.2. promised to fix this issue - but didn’t work. Also, all non-critical plugins have been turned off.

Hi @teog,

This error message:

“PHP Fatal error: Uncaught --> Smarty Compiler: Syntax error in template “app:app:frontendpagespurchaseInst” on line 23 “{assign var=“formPath” value={“institutional”:to_array:$subscriptionId}}” - Unexpected “:”, expected one of: “}” <-- thrown in /home/…/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 

…has been filed at Template syntax error in purchaseInstitutionalSubscription.tpl · Issue #121 · NateWr/bootstrap3 · GitHub and there’s a patch there for it.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher, but if by patch you mean for the issue 121 → core 3933 → pkp/ojs@9363b4a - it has been already incorporated in OJS 3.1.2 (this is a clean install). Just in case, I did try both the " | " and " : " variants, but the error remains. Also, I tried removing the redundant curly braces but to no avail. If it helps: the “Purchase Institutional Subscription” page is never presented due to Error 500 right upon clicking on the “Purchase New Subscription” link in about/subscriptions.

If it helps further: today I tried clean-installing the new OJS 3.1.2.1. in a different folder/subdomain of the same domain in which the above installation resides, but couldn’t pass the config.inc.php initial screen - upon filling all the info and confirming, nothing happens. No error messages (on-screen or in error_log) and nothing is changed in the config.inc.php nor database created. Editing config and creating db manually had no effect either. So I gave up on OJS 3.1.2.1. Could it be that something is wrong with the server settings? It’s a typical Apache/Linux with PHP up to 7.3 (I tried both 7.0 and 7.1) and all the bells and whistles.

What about the Omnipay’s strange string error? It is produced by the message key=“plugins.paymethod.paypal.error”> in plugins/paymethod/paypal/locale/en_US/locale.xml. Interestingly, the Manual Payment works.

Hi @teog,

The message:

“PHP Fatal error: Uncaught --> Smarty Compiler: Syntax error in template “app:app:frontendpagespurchaseInst” on line 23 “{assign var=“formPath” value={“institutional”:to_array:$subscriptionId}}” - Unexpected “:”, expected one of: “}” <-- thrown in /home/…/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 

…will definitely be fixed by changing…

{assign var="formPath" value={"institutional":to_array:$subscriptionId}}

…to this formulation

{assign var="formPath" value="institutional"|to_array:$subscriptionId}

I would recommend continuing to work with OJS 3.1.2-1 – I’m not sure what’s causing the installation problems you’re encountering; I’d suggest making sure you’re starting with a clean directory and either a totally empty database or a copy of your older database if you’re following the upgrade process. If there are issues in 3.1.2-1 I will make sure to help you debug them; it would be time better spent than trying to debug an older version, as anything needing work on the freshest release will be identified more quickly that way.

There should be an error logged in the PHP error log at the moment the following message appears: A transaction error occurred. Please contact the journal manager for details.

Regards,
Alec Smecher
Public Knowledge Project Team

That took care of the Institutional subscriptions problem and the associated Error 500, thanks @asmecher!

Installation of 3.1.2.1 will have to wait for now. But it doesn’t seem to be much to gain, going from 3.1.2.0? I mean, no security patches, just some cosmetics and added functionality, afaict?

As for the PayPal error message when attempting to purchase an individual subscription, the PHP log contains POST and GET entries with some error labels it seems:
GET /purchaseSubscription/individual HTTP/2" 200 4913 “/about/subscriptions” “Mozilla/5.0 (Wind$
POST /payPurchaseSubscription/individual/ HTTP/2” 200 4704 "/user/purchaseSubscription/individu$

I am not good with PHP or its error structure - do these logs tell you anything useful?

Also, I noticed a pertaining PHP Warning in the server’s error_log - perhaps of use too:
PHP Warning: Declaration of IndividualSubscriptionsGridHandler::renderFilter($request) should be compatible with SubscriptionsGridHandler::renderFilter($request, $filterData = Array) in /controllers/grid/subscriptions/IndividualSubscriptionsGridHandler.inc.php on line 20

Again, although the REST API credential are all correctly pasted from developer.paypal.com, perhaps I messed up with their webhooks? What is the correct format for a PayPal webhook on an OJS3 installation anyway? I don’t recall seeing that explained anywhere really. Provided that they are critical to have, that is. Additionally, I do have restful_urls = On in config.inc.php, so perhaps this interferes with their webhook structure?

Hi @teog,

There’s nothing unusual about the two access log entries – the 200 indicates that they appear to have been handled successfully. The warning message from the PHP error log is cosmetic and won’t cause problems.

Regards,
Alec Smecher
Public Knowledge Project Team