Warning by code in class.usertagoperations.inc.php ? Topic is solved

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 41
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Warning by code in class.usertagoperations.inc.php ?

Post by AccentAvondschool »

Hi,

My logfile on the server is filled with the following warning ....
[Thu Oct 28 09:21:34.603124 2021] [fcgid:warn] [pid 1036:tid 139827971340032] [client xx.xxx.xx.xxx:xxxxx] mod_fcgid: stderr: PHP Warning: Use of undefined constant round - assumed 'round' (this will throw an Error in a future version of PHP) in /var/www/vhosts/xxxx.nl/httpdocs/lib/classes/class.usertagoperations.inc.php(305) : eval()'d code on line 3, referer: https://www.xxxx.nl/
Line 305 of class.usertagoperations.inc.php contains: @eval($code);
Can I change this myself to something that no longer gives this warning and filling my logfile with hundreds of these rows?
Regards,

Accent Avondonderwijs
René
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1921
Joined: Mon Jan 29, 2007 4:47 pm

Re: Warning by code in class.usertagoperations.inc.php ?

Post by Jo Morg »

AccentAvondschool wrote: Thu Oct 28, 2021 11:43 am

Code: Select all

eval()'d code on line 3
That means that the code is in the UTD itself... not on the file you are pointing to. You'll have to search which udt is causing it.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 41
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Re: Warning by code in class.usertagoperations.inc.php ?

Post by AccentAvondschool »

Hi Jo,

Thanks for your quick response. I've checked my code on it and I indeed use the eval in two ways...

In several content blocks (in a modal as an example)

Code: Select all

{eval cgsimple::get_page_content('security')}
in UDT

Code: Select all

$smarty_data = "{include file='cms_template:courses_costs'} ";
$smarty->display('eval:'.$smarty_data);
The reason is that otherwise I will not see the desired data :-\

Any idea how i can adjust this?
Regards,

Accent Avondonderwijs
René
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1921
Joined: Mon Jan 29, 2007 4:47 pm

Re: Warning by code in class.usertagoperations.inc.php ?

Post by Jo Morg »

You misinterpreted me, or I wasn't very clear... The offending code is in a UDT (User Defined Tag) which is a snippet of PHP that is created by the user and that can then be used as a Smarty tag on your templates. You'll have to look inside the UDTs for the occurrence of the word round on line 3 of the said UDT. Not a template itself but a tag in a template. Again look in the list of your User Defined Tags, there is a CMSMS page on the admin side just for those, and open the ones you may be using that might have that bit that is triggering the notice.
On a side note: notices and warnings are not usually an issue and usually you can lower the level of logged types of events on php.ini to something like
error_reporting = E_ERROR | E_PARSE
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 41
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Re: Warning by code in class.usertagoperations.inc.php ?

Post by AccentAvondschool »

I had already searched my UDTs for 'round' and as I couldn't find anything I thought it was 'eval'.
Anyway, 'round' can't be found in my custom plugins either, after that I made a SQL dump and the word 'round' isn't in there either.
I also did an flush/clear cache so I don't know what to do anymore :(

Unfortunately I cannot change the php.ini myself, then I will have to ask the provider.

Thank you for your patience and your detailed answers ... again.
It's exactly what you said, notices and warnings are not usually an issue.
Regards,

Accent Avondonderwijs
René
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Warning by code in class.usertagoperations.inc.php ?

Post by velden »

Any chance the UDT is loading external data (eg from a file, an external database, web service, etc..)?
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 41
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Re: Warning by code in class.usertagoperations.inc.php ?

Post by AccentAvondschool »

Thx Velden for your response.

Jo's answer didn't let me go and I searched all UDT's again a few days later. And guess what, Jo was right, somewhere in the depths I found an UDT with the following code for the clocks on https://www.accentavondschool.nl/cursus/cursustijden ...

Code: Select all

$h += (($params['m'] * 0.4)|round);
Probably ever a custom plugin tryout? And strange that I couldn't find it in the SQL file? Anyway, changed it to ...

Code: Select all

$h += round($params['m'] * 0.4);
... and all notifications now stay away.

Thank you all so much for thinking along
Regards,

Accent Avondonderwijs
René
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Warning by code in class.usertagoperations.inc.php ?

Post by velden »

You probably will love the updated Admin Search in the upcoming version (2.2.16) which also searches in UDTs
New admin search
New admin search
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 41
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Re: Warning by code in class.usertagoperations.inc.php ?

Post by AccentAvondschool »

I love new updates of this fantastic CMS anyway. But after every update I catch myself that I keep checking (with a pounding heart) whether all installed (custom) modules /(custom) plugins / written UDT's / etc still work well with the new update :o Of course I made/have backups and luckily it hasn't happened yet but then I have a lot to figure out/recover.

Off-topic : is there a book you can recommend that goes in depth on this CMS above v1.9 ?
Regards,

Accent Avondonderwijs
René
JamesT
Forum Members
Forum Members
Posts: 175
Joined: Tue Sep 08, 2015 10:41 am

Re: Warning by code in class.usertagoperations.inc.php ?

Post by JamesT »

velden wrote: Sat Nov 06, 2021 12:58 pm the upcoming version (2.2.16)
Official PHP 8 support, please. 🙏
Post Reply

Return to “CMSMS Core”