reload issues

Discussion corner for Developers of Serendipity.
Post Reply
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

reload issues

Post by Timbalu »

Maybe this is a better place here to discuss that reloading problem behaviour to get fixed since S9y-1.6. I found these by testing the 1.7 RC versions.

Archiv:
Thread started here http://board.s9y.org/viewtopic.php?f=10 ... 1&start=30 (german) and followed in comments of https://github.com/s9y/Serendipity/comm ... 4aee8f07dd (english).

Changing Themes brought up some unwanted behaviours.... on first page load:
  • 1. Theme, particularly Bulletproof, css needed a non-cache css includement... (1)
  • 2. Templates showed old $template_config_groups... (1)
  • 3. Some more of the global vars were transported to themes not using them... (1)
  • 4. The old navigation array rendering does not work any more (except amount)...
(1) possibly fixed in 2.0.

Copy of my last post, related to 4:
I was quite on this for a few days - but now had this

Code: Select all

Fatal error: Uncaught exception 'ErrorException' with message 'constant(): Couldn't find constant NAV_DEFAULT_4' in ...config.inc.php
on template change. This happens if you change a template - for example (a)xcur (mind the c) - and reset the default amount 4 to 3 - safe it - then change to a new theme andreas09.
Then this bug appears until you reload the page with F5. After that everything is OK again and the new template has arrived!
This is also related to all of these described "keeping old config setting until next reload" "bug" behaviours.
With production true it won't stop to error, but still throws a

Code: Select all

Warning: constant(): Couldn't find constant NAV_DEFAULT_4 in /templates/andreas09/config.inc.php on line 55
Is that still something we want to wait for?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: reload issues

Post by garvinhicking »

Hi!

Moved to Development, this is the better place.

[*]3. Some more of the global vars were transported to themes not using them... (1)

IMO its better to transfer all old settings to a new template where they could be used, better than omitting the values and they get lost forever.

The navigation array would need to be changed in the config.inc.phps, to make sure that constants are actually defined() before they use it, to prevent the error you describe...

Best 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/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: reload issues

Post by Timbalu »

garvinhicking wrote:The navigation array would need to be changed in the config.inc.phps, to make sure that constants are actually defined() before they use it, to prevent the error you describe...
Yes, we could do this for all templates in reach, but not for those being renamed and still in use in the wild. This is the point where it starts to break... (and this relates to all of these reloading issues).
The other thing is, that this old config navigation rendering is not being used any more at all, if you really look into and compare to what is displayed. Please view and try yourself. Just to be clear to any reader: It does not break having a navigation at all, it does break the default old config settings.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Re: reload issues

Post by mattsches »

Is it just me, or

Code: Select all

mattsches@kormoran:/path/to/s9y.local/httpdocs/templates/axcur$ php -l config.inc.php 
PHP Parse error:  syntax error, unexpected end of file in config.inc.php on line 217
Errors parsing config.inc.php
This prevented me from upgrading to RC4. Locally fixed now.

I tried to reproduce your bug, Timbalu, but am not getting any warning when switching between axcur and andreas09 themes ...
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: reload issues

Post by Timbalu »

Just fixed. Please delete and load new one tomorrow via spartacus.
This file had so many whitespaced lines and the previous cleanup deleted a loop end.

For the other.... did you reset amount in axcur first from 4 to 3?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Re: reload issues

Post by mattsches »

Timbalu wrote:For the other.... did you reset amount in axcur first from 4 to 3?
I did, I also tried other (higher) values .. still don't get any errors. Actually, I am not getting any warnings at all. Maybe this is due to my error_reporting level, but I don't have time right now to look into that :? Sorry
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: reload issues

Post by Timbalu »

Strange... I did this with a plain new RC3 install now. Same errors and even one more old category fetch bug to fix in axcur (which I commited to be fixed now).
Did you enable the horizontal menue in both templates?
I have andreas09 with amount 5 (which is the default amount of global nav) here and (a)xcur with 5 or 4 or 3 - changing back to andreas09 brings up this constant error, which is based to this lagged reload issue already described.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: reload issues

Post by Timbalu »

Just as a sidenote: commiting some fixes to additional themes, I also disabled two possible doublettes of category creation in (a)xcur and mo3 - does anyone know if they were added twice to the config.inc because of a special reason?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Re: reload issues

Post by mattsches »

Timbalu wrote:Just as a sidenote: commiting some fixes to additional themes, I also disabled two possible doublettes of category creation in (a)xcur and mo3 - does anyone know if they were added twice to the config.inc because of a special reason?
Looks like unintentional copy & paste to me ...
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: reload issues

Post by yellowled »

Given the slightly messy state of the config.inc.php, I'd guess it's some kind of c & p error.

YL
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Re: reload issues

Post by mattsches »

Timbalu wrote:Strange... I did this with a plain new RC3 install now. Same errors and even one more old category fetch bug to fix in axcur (which I commited to be fixed now).
Did you enable the horizontal menue in both templates?
I have andreas09 with amount 5 (which is the default amount of global nav) here and (a)xcur with 5 or 4 or 3 - changing back to andreas09 brings up this constant error, which is based to this lagged reload issue already described.
I've just tried again, cannot reproduce this. I even manually deleted some keys from the s9y_options table - nothing.

From the manual:
constant() Returns the value of the constant, or NULL if the constant is not defined.
So, looks like constant() indeed returns NULL here, but does not emit a warning. Question is, why?
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: reload issues

Post by Timbalu »

Hmm, another try:
1. empty options table
2. chose 2k11 as template
3. allow global nav with default amount 5
4. change to andreas09
==error==

again, I know this could be solved by adding something like is_defined() to these templates, but this would not hit all others templates out there still in use (and the same for all other related errors trying to fix in a templates config.inc).
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Post Reply