Help - Search - Members - Calendar
Full Version: Post By Email Pro - Cron Warnings
Web Design Seo Forum > 3D Web Design English Forum > Joomla Extensions
Brian Craigie
Hi,

When I run the cron (... is my own path to the web folder)

/bin/php -q .../administrator/components/com_post_by_email/cron.post_by_email.php >> /dev/null

, I get the following warnings:

PHP Notice: Constant JROUTER_MODE_RAW already defined in .../libraries/import.php on line 60
PHP Notice: Constant JROUTER_MODE_SEF already defined in .../libraries/import.php on line 67

It would be nice to silence those warnings by fixing the php code. :-)
Web Design Seo
Brian Craigie, there is no JROUTER_MODE_RAW and JROUTER_MODE_SEF constants in whole "Post by email" component, these constants and errors are NOT from our component. Also, there is no folder or file with name "libraries" in "Post by email" component.

Probably errors are from "libraries" folder of your version of Joomla.
Brian Craigie
QUOTE (Web Design Seo @ Jan 31 2019, 08:42 AM) *
Brian Craigie, there is no JROUTER_MODE_RAW and JROUTER_MODE_SEF constants in whole "Post by email" component, these constants and errors are NOT from our component. Also, there is no folder or file with name "libraries" in "Post by email" component.

Probably errors are from "libraries" folder of your version of Joomla.


Thanks smile.gif

However if you look at your code administrator/components/com_post_by_email/cron.post_by_email.php

you will see:

CODE
49 require_once(JPATH_BASE.DS.'includes'.DS.'framework.php');
50
51 // Get the framework.
52 require_once JPATH_LIBRARIES . '/import.php';


includes/framework.php does this:

CODE
require_once JPATH_LIBRARIES . '/import.legacy.php';


import.legacy.php does this:

CODE
const JROUTER_MODE_RAW = 0;
const JROUTER_MODE_SEF = 1;


And then on line 52 in your script, you require import.php which also does:

CODE
const JROUTER_MODE_RAW = 0;
const JROUTER_MODE_SEF = 1;


This is what causes the warning that these constants are already defined.

My suggestion is you don't need to require both framework.php and import.php

Your script produces no errors if I comment out line 52 which requires the import.php

Hope this helps. smile.gif



Web Design Seo
Thanks, Brian. Extension is not updated from many time, but Joomla was changed, libraries files also. I will check it today and will made changes.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2026 Invision Power Services, Inc.

Web Analytics