PHP Warning: Use of undefined constant IN_serendipity_admin

Found a bug? Tell us!!
Post Reply
hanno
Regular
Posts: 72
Joined: Fri May 20, 2005 8:04 am
Contact:

PHP Warning: Use of undefined constant IN_serendipity_admin

Post by hanno »

I'm getting warnings in my PHP log when using PHP 7.2:

[30-Nov-2017 23:57:01 Europe/Berlin] PHP Warning: Use of undefined constant IN_serendipity_admin - assumed 'IN_serendipity_admin' (this will throw an Error in a future version of PHP) in [path]/include/functions_smarty.inc.php on line 1005
[30-Nov-2017 23:57:01 Europe/Berlin] PHP Warning: Use of undefined constant IN_serendipity_admin - assumed 'IN_serendipity_admin' (this will throw an Error in a future version of PHP) in [path]/include/functions_smarty.inc.php on line 1022

I'm not entirely clear what that means, it seems to think the single quotes are part of the constant name.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: PHP Warning: Use of undefined constant IN_serendipity_a

Post by garvinhicking »

Thanks & sorry for late response. A "defined('IN_serendipity_admin')" check is needed for forward compatibility. I just committed it to our 2.1 branch and master.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
elguenny
Regular
Posts: 5
Joined: Mon Feb 15, 2016 7:26 pm

Re: PHP Warning: Use of undefined constant IN_serendipity_a

Post by elguenny »

FYI, if I switch to PHP 7.2.1 I get another warning in serendipity_config.inc.php. PHP 7.1.x is working fine without warnings.

Code: Select all

Use of undefined constant CHARSET_NATIVE - assumed 'CHARSET_NATIVE' (this will throw an Error in a future version of PHP) in /home/www/blog/serendipity_config.inc.php on line 183
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: PHP Warning: Use of undefined constant IN_serendipity_a

Post by garvinhicking »

Hey,
many thanks for reporting. This was another instance of using an uninitialized constant, I've fixed this in our git 2.1 & master.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
hanno
Regular
Posts: 72
Joined: Fri May 20, 2005 8:04 am
Contact:

Re: PHP Warning: Use of undefined constant IN_serendipity_a

Post by hanno »

More such warnings as part of the "podcast" plugin:

[26-Mar-2018 22:00:08 Europe/Berlin] PHP Warning: Use of undefined constant PLUGIN_PODCAST_QTEXT_DDEFAULT - assumed 'PLUGIN_PODCAST_QTEXT_DDEFAULT' (this will throw an Error in a future version of PHP) in /home/hanno/websites/blog.hboeck.de/htdocs/plugins/serendipity_event_podcast/serendipity_event_podcast.php on line 1215
[26-Mar-2018 22:00:08 Europe/Berlin] PHP Warning: Use of undefined constant PLUGIN_PODCAST_WMEXT_DDEFAULT - assumed 'PLUGIN_PODCAST_WMEXT_DDEFAULT' (this will throw an Error in a future version of PHP) in /home/hanno/websites/blog.hboeck.de/htdocs/plugins/serendipity_event_podcast/serendipity_event_podcast.php on line 1216
[26-Mar-2018 22:00:08 Europe/Berlin] PHP Warning: Use of undefined constant PLUGIN_PODCAST_MFEXT_DDEFAULT - assumed 'PLUGIN_PODCAST_MFEXT_DDEFAULT' (this will throw an Error in a future version of PHP) in /home/hanno/websites/blog.hboeck.de/htdocs/plugins/serendipity_event_podcast/serendipity_event_podcast.php on line 1217
[26-Mar-2018 22:00:08 Europe/Berlin] PHP Warning: Use of undefined constant PLUGIN_PODCAST_AUEXT_DDEFAULT - assumed 'PLUGIN_PODCAST_AUEXT_DDEFAULT' (this will throw an Error in a future version of PHP) in /home/hanno/websites/blog.hboeck.de/htdocs/plugins/serendipity_event_podcast/serendipity_event_podcast.php on line 1218
[26-Mar-2018 22:00:08 Europe/Berlin] PHP Warning: Use of undefined constant PLUGIN_PODCAST_XSPFEXT_DDEFAULT - assumed 'PLUGIN_PODCAST_XSPFEXT_DDEFAULT' (this will throw an Error in a future version of PHP) in /home/hanno/websites/blog.hboeck.de/htdocs/plugins/serendipity_event_podcast/serendipity_event_podcast.php on line 1219
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: PHP Warning: Use of undefined constant IN_serendipity_a

Post by garvinhicking »

Thanks, fixed!
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
hanno
Regular
Posts: 72
Joined: Fri May 20, 2005 8:04 am
Contact:

Re: PHP Warning: Use of undefined constant IN_serendipity_admin

Post by hanno »

One more such warning in the installer code:

Warning: Use of undefined constant S9Y_DB_INCLUDED - assumed 'S9Y_DB_INCLUDED' (this will throw an Error in a future version of PHP) in /[path]/include/functions_installer.inc.php on line 650
orang
Regular
Posts: 23
Joined: Wed Aug 16, 2006 9:03 am

Re: PHP Warning: Use of undefined constant IN_serendipity_a

Post by orang »

garvinhicking wrote: Mon May 14, 2018 2:46 pm Thanks, fixed!
Hi Garvin,

I get the same problem, but I'm not sure I get what I have to do to fix it. Could you explain that? Do I have to update/install something?


Thanks,
Stefan
thh
Regular
Posts: 419
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: PHP Warning: Use of undefined constant IN_serendipity_a

Post by thh »

orang wrote: Fri Jan 11, 2019 1:21 pm
garvinhicking wrote: Mon May 14, 2018 2:46 pm Thanks, fixed!
I get the same problem
Which one? :)
orang wrote: Fri Jan 11, 2019 1:21 pmbut I'm not sure I get what I have to do to fix it. Could you explain that? Do I have to update/install something?
It's fixed in the git repository, but not yet released.

You can
- look up the fixes in our code repository and adopt them in your version of s9y
- check out the version from git and update to that
- wait for the release

In general, s9y is not yet ready for prime time on PHP 7.2; you should run it with 7.1 or even 7.0, if possible.
Post Reply