Error Notice in Order status notification Email

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
9 years 4 months ago #206273

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.3.28
-- Error-message(debug-mod must be tuned on) -- : Notice: Use of undefined constant JPATH_COMPONENT - assumed 'JPATH_COMPONENT' in /home/icxdev04/public_html/libraries/legacy/view/legacy.php on line 164

I notice this after the 2.5.0 update on a development site - but I am not certain whether it was there immediately before.

Notice: Use of undefined constant JPATH_COMPONENT - assumed 'JPATH_COMPONENT' in /home/icxdev04/public_html/libraries/legacy/view/legacy.php on line 164

I confirmed that I am using the default template for that email. It does not appear in other Order emails, including one which I customized. I am not sure how to correct this error, or even hide it without lowering the reporting error level.

Last edit: 9 years 4 months ago by icomex.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 4 months ago #206302

Hi,

When is that message displayed ? In the email received by the customer ?
If you change the order status in the backend, and you enable the option to notify the customer, is that error displayed too ?

Could you try for testing purposes to add the line: define(JPATH_COMPONENT,'hikashop'); at the top of the preload part of the order status notification email ?

Please Log in or Create an account to join the conversation.

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
9 years 4 months ago #206363

It is in the customer notification email.

I will run the local status change test, and then add the line to the template preload and let you know what I learn. (I did verify that the template involved was using the declared 2.5.0 versions of the template code.)

Please Log in or Create an account to join the conversation.

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
9 years 4 months ago #206366

Changing the status in the back end and sending a customer notification did not produce the error.

Immediately making another purchase displayed the error as expected. Apparently it only happens during the automated PayPal confirmation after a purchase.

Adding the suggested line to the preload section of the email template and making another purchase changed the error:

Notice: Use of undefined constant JPATH_COMPONENT - assumed 'JPATH_COMPONENT' in /home/icxdev04/public_html/media/com_hikashop/mail/order_status_notification.preload.modified.php on line 9

Line 9 being the line where I added the provided line of code.

Last edit: 9 years 4 months ago by icomex.

Please Log in or Create an account to join the conversation.

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
9 years 4 months ago #206406

OK, I have made the error go away but I have absolutely no idea how. But it did use your suggested line of code.

I was thinking through the sequence of events during a purchase/paypal payment/confirmation/thanks page and decided the only non-Hika code running between handing off to PayPal and sending the notification email could be our own custom plugin, which has a call for onAfterOrderCreate and onAfterOrderUpdate triggers. Now nowhere in that plugin is there a usage of JPATH_COMPONENT. In fact, the onAfterOrderUpdate only calls the DBO object and issues two direct queries to the database. That's it. Over the entire plugin, it loads the application, it loads the user and it loads the DBO. Nothing else that even uses a path as far as I know.

But putting your line

define(JPATH_COMPONENT,'hikashop');
at the top of the plugin has made the error go away.

I have no idea how or why. But maybe that will help you track down the weirdness.
I'll include the plugin file, just in case it helps.

File Attachment:

File Name: brainstyles_php.zip
File Size:3 KB

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 4 months ago #206402

There is a typo in the code provided by Xavier.
Try like this instead:
define('JPATH_COMPONENT','hikashop');

Please Log in or Create an account to join the conversation.

Time to create page: 0.136 seconds
Powered by Kunena Forum