I was trying to add {if $view == 'entry'} to a template and not getting the results I expected. After looking at this thread, I decided to test if it might be a plugin and found the culprit was serendipity_event_customarchive.
How can I possibly remedy this without disabling this plugin? I tried adding 'return true;' after 'case 'genpage':' as suggested at the thread above but it made no difference here.
$view not working with serendipity_event_customarchive
$view not working with serendipity_event_customarchive
Last edited by Christine on Mon Aug 07, 2017 6:36 pm, edited 1 time in total.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: $view not to working with serendipity_event_customarchiv
Which Serendipity version are you using?
Did you actually try to disable the customarchive plugin and does your template check on $view then work? Because actually inserting the "return true" in the genpage hook of the plugin file should really bypass any other assignment of the serendipity viewtype.
To test this, could you add a:
after serendipity_smarty_init in serendipity_event_customarchive for the first occurence, and a
after the second one? Then also add that "return true" statement in the genpage hook. Then open the page and check if you get any of the init1/2 output statements?
When you print {$view} in your template file, do you get an empty string or is it set to "default"?
Regards,
Garvin
Did you actually try to disable the customarchive plugin and does your template check on $view then work? Because actually inserting the "return true" in the genpage hook of the plugin file should really bypass any other assignment of the serendipity viewtype.
To test this, could you add a:
Code: Select all
die('init1');
Code: Select all
die('init2');
When you print {$view} in your template file, do you get an empty string or is it set to "default"?
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/
# 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/
Re: $view not to working with serendipity_event_customarchiv
Yes, I did a fresh install (2.1.1) of Serendipity and added the plugins once at a time until the problem occurred. Then I disabled all but customarchive. Then I disabled and reenabled customarchive and yes, $view would only work when it was disabled. I then went to my active blog (2.0.3) and disabled it and same deal - $view only working when customarchive disabled. (By the way, $category was working fine).garvinhicking wrote:Did you actually try to disable the customarchive plugin and does your template check on $view then work?
I don't know what's happened, but it's working now. I tested it repeatedly in both versions, hard refresh, clearing cache etc., but it did nothing. My site was down this morning and my hosting has just restarted the server, maybe that did it? I have no idea, but there's nothing else that changed.Because actually inserting the "return true" in the genpage hook of the plugin file should really bypass any other assignment of the serendipity viewtype.
Is it OK to leave the 'return true' in the genpage hook if it's working, or would it affect something else?
Re: $view not to working with serendipity_event_customarchiv
For which versions of serendipity would this work?garvinhicking wrote:Which Serendipity version are you using?
Did you actually try to disable the customarchive plugin and does your template check on $view then work? Because actually inserting the "return true" in the genpage hook of the plugin file should really bypass any other assignment of the serendipity viewtype.
To test this, could you add a:
after serendipity_smarty_init in serendipity_event_customarchive for the first occurence, and aCode: Select all
die('init1');
after the second one? Then also add that "return true" statement in the genpage hook. Then open the page and check if you get any of the init1/2 output statements?Code: Select all
die('init2');
When you print {$view} in your template file, do you get an empty string or is it set to "default"?
Regards,
Garvin
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: $view not to working with serendipity_event_customarchiv
Hi!
It would work for any s9y version after 2.0 - where we upgraded to Smarty 3, which required us to change some init things around.
@Christine: The additional smarty init is there for the case that the archive plugin is called on pages or embedded blogs, where the smarty object has not yet been initiated. In normal operation it should exist, but this duplicate call will then instantiate a fresh smarty object without the assigned global variables. I will need to think of a way to not perform this step, but I would need to gather all the circumstancial variables to not break things on another end. For the time being I'd suggest to use this workaround...
It would work for any s9y version after 2.0 - where we upgraded to Smarty 3, which required us to change some init things around.
@Christine: The additional smarty init is there for the case that the archive plugin is called on pages or embedded blogs, where the smarty object has not yet been initiated. In normal operation it should exist, but this duplicate call will then instantiate a fresh smarty object without the assigned global variables. I will need to think of a way to not perform this step, but I would need to gather all the circumstancial variables to not break things on another end. For the time being I'd suggest to use this workaround...
# 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/
# 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/
Re: $view not to working with serendipity_event_customarchiv
So no versions before 2.0 would be suitable?
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: $view not to working with serendipity_event_customarchiv
I don't remember, but you shouldn't run those older versions of serendipity anymore anywayszarzanola wrote:So no versions before 2.0 would be suitable?
# 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/
# 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/