Not a bug - Cron Warning

Post Reply
Eddy
Posts: 121
Joined: 28 Dec 2017, 03:38
Name: Eduardo
Location: UK

Not a bug - Cron Warning

Post by Eddy »

In the spirit of helping... I am getting this message from Cron every time system runs a backup.

PHP Warning: Use of undefined constant TEXT_ADMINISTRATOR - assumed 'TEXT_ADMINISTRATOR' (this will throw an Error in a future version of PHP) in /var/www/mydomain.com/includes/classes/users/users.php on line 96

Regards
Eddy
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Not a bug - Cron Warning

Post by support »

Replace attached file in /cron folder.
Let me know if it fixed.
Attachments
backup.php
(284 Bytes) Downloaded 219 times
Eddy
Posts: 121
Joined: 28 Dec 2017, 03:38
Name: Eduardo
Location: UK

Re: Not a bug - Cron Warning

Post by Eddy »

Replaced the file and it is the same... Cron will send the same warning bye-mail.

I found this link on internet http://thisinterestsme.com/use-of-undefined-constant/.

Is TEXT_ADMINISTRATOR a variable?

Should the users.php code (referenced in the Warning message path. Line 96) have a $ sign like this:

Code: Select all

      $cache[$users['id']] = array(
                'name'  => $name,
                'email' => $users['field_9'],
                                        'photo' => $photo,
                                        'group_id' => (int)$users['field_6'],
                'group_name'=> ($users['group_id']>0 ? $users['group_name'] : $TEXT_ADMINISTRATOR),
                                        'profile'       => $profile_fields
 
Instead of:

Code: Select all

      $cache[$users['id']] = array(
                'name'  => $name,
                'email' => $users['field_9'],
                                        'photo' => $photo,
                                        'group_id' => (int)$users['field_6'],
                'group_name'=> ($users['group_id']>0 ? $users['group_name'] : TEXT_ADMINISTRATOR),
                                        'profile'       => $profile_fields
 
Post Reply