Page 1 of 1

1.3 alpha - unexpected sidebar error

Posted: Thu Dec 06, 2007 4:07 pm
by Don Chambers
I recently upgraded to the 1.3 alpha release via svn.... using the bulletproof template, I selected one of our options that displays only a single sidebar... specifically our B-S option (blog first, right sidebar only). Our bp code under this scenario will print all left sidebar items first, followed by all right sidebar items, but keep them all on the right side:

Code: Select all

                    {serendipity_printSidebar side="left"}
                    {serendipity_printSidebar side="right"}
Notice we are not using an {if} to determine whether or not left or right side items actually exist. Under 1.2, this was not a problem.

However, with 1.3, an error is triggered if one of the sidebars does not contain any items. Now, this is easily solved by this:

Code: Select all

                {if $leftSidebarElements > 0}
                    {serendipity_printSidebar side="left"}
                {/if}
                {if $rightSidebarElements > 0}
                    {serendipity_printSidebar side="right"}
                {/if}
What confuses me is two-fold... first, we didn't need the {if} in s9y 1.2... no error was triggered. Second, even after I installed 1.3alpha, I was not getting any error at all for approximately 3 days - it suddenly appeared after I was deleting some existing categegories I had been using for test purposes. The categories never had anything to do with the sidebar items, so I cannot imagine why it worked without error for several days, and then I suddenly started getting this error when - in my case - no left sidebar items existed.

Soooooo.... anyone care to offer an explanation? I wanted to bring it up in case it is actually something that needs to be fixed in 1.3, and not a template.

BTW - the error was something like "Cannot include blah blah".. I can't remember the actual error... but it should be easy enough to recreate.

Re: 1.3 alpha - unexpected sidebar error

Posted: Thu Dec 06, 2007 7:47 pm
by garvinhicking
Hi!

Supposedly the error was already there in 1.2 but simply ommitted, because only -alpha versions have an increase PHP error reporting level!

Try to set $serendipity['version'] = '1.3' instead of '1.3-alpha' and see if it goes away?

BTW: Which error do you get ,actually? :-D

Regards,
Garvin

Posted: Thu Dec 06, 2007 8:11 pm
by Don Chambers
I went ahead and removed my fix so the error would surface again.... here is the actual generated html:

Code: Select all

<h3 class="serendipitySideBarTitle ">Error</h3>
                  <div class="serendipitySideBarContent">serendipity error: could not include  - exiting.</div>
$serendipity['versionInstalled'] = '1.3'; in config_local still produces the error.

Posted: Thu Dec 06, 2007 10:28 pm
by judebert
Odd. That looks like a plugin error to me. I'm imagining an event plugin whose output goes into the sidebar, or the contents of a WrapURL plugin. It looks like the wrapped plugin is trying to include something with no name.

Posted: Thu Dec 06, 2007 11:21 pm
by garvinhicking
Hi!

What you get there is the output of the constant "INCLUDE_ERROR".

This can actually only happen, if you are missing a PHP file for one of your sidebar plugins. Check your "configure plugins" section: I bet there's an error listed for one of the sidebar plugins?

Also check your serendipity_plugins table, see if the "path" value there is always containing a proper path. Noweher should the plugin-ID be used in the "path" column...

REgards,
Garvin

Posted: Fri Dec 07, 2007 12:09 am
by Don Chambers
I can trigger this error on a live site, and my sandbox.... In both instances, all I need to do is have nothing in my left sidebar. The moment I have at least one - any one - plugin on the left, I do not get the error. Is that consistent with your suspicion Garvin?

Interestingly enough, it is only on my frontpage... and I am trying to do some things differently on that page.... but again, this error is popping up in the sidebar, and does not happen as long as I use {if $leftSidebarElements > 0}

I have no left sidebar items, and all of my right sidebar items are shown correctly. The error appears as the first sidebar item (ie, as if it was a sidebar plugin itself).

My configure plugins screen shows no errors.
Also check your serendipity_plugins table, see if the "path" value there is always containing a proper path. Noweher should the plugin-ID be used in the "path" column...
About half of them are blank, the other half all appear to be the plugin name, ie serendipity_event_entryproperties

Posted: Fri Dec 07, 2007 1:28 am
by garvinhicking
Hi!

It could be related to your event plugins, which might set invalid data for the $plugins variable. Can you strip down your event plugins and disable them all, temporarily? If it works without event plugins, switch them on again one by one and see which one is the cause for it.

Also, you could check the generate_plugins() method of include/plugin_api.inc.php and add a print_r($plugins) before the foreach($plugins AS $plugin_data) loop.

regards,
Garvin

Posted: Fri Dec 07, 2007 6:22 pm
by Don Chambers
It is serendipity_fetchPrintEntries creating the error.....

I have a few different cases of this, usually fetching for a particular category, but still using (unless I change it since it also has another problem) the entries.tpl file. This is one of them:

Code: Select all

        {serendipity_fetchPrintEntries limit="0,5" category="24" full="false" use_footer="false" skip_smarty_hooks="true" template="entries.tpl"}

Posted: Sat Dec 08, 2007 4:32 pm
by garvinhicking
Hi!

Guess I'll be able to check it out then once you send me your template.

Regards,
Garvin