PHP coding problem

Status
Not open for further replies.

wezetel

Active Member
As Joomla articles don't have the possibility to do an automatic archive, I created a custom Joomla field (date).
Then I created a Fabrik scheduled task (php) to set the archive attribute of articles, where the field value is less than the current date.
This works on my production site with J3F3Php7. On my development site with J4F4Php8 I get an error:
Call to undefined function checkArchiving()
Not sure, what is causing this error (Joomla, Fabrik or PHP).
I have attached both versions.
Does anyone have an idea, what I'm doing wrong?
 

Attachments

  • WorkingJ3F3Php7.txt
    1.8 KB · Views: 42
  • NotWorkingJ4F4Php8.txt
    1.8 KB · Views: 43
It's related to the new php code eval.
And it's working if you put your function definitions before the code (because of ???).

BTW: you can use #__content instead of prefix_content
 
Thanks a lot @troester , reordering the code solved the problem, even if I now get a depreciated warning:
Ein Fehler mit einem berechneten Feld ist aufgetreten - bitte informieren Sie den Betreiber der Web-Seite. Debug: Caught exception on eval of cron php_code: Joomla\CMS\Factory::getDbo() is deprecated. Load the database from the dependency injection container.

Regarding the #-notation: good tipp for the future, so I can easily copy the code from one server to another. First I made the error to use 3 underscores (as used from fabrik), until I discovered only 2 are required :)
 
Obviously not (but this is nothing I can change).
Closing it for you.

Joomla\CMS\Factory::getDbo() is deprecated....
you still have/had one in setToArchived
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top