smarty $view no longer available

Discussion corner for Developers of Serendipity.
User avatar
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert » Tue Jun 17, 2008 8:11 pm

Well.

This was an adventure.

Turns out that the entries.tpl gets called before the frontend_header hook. Who knew? (It's probably in Garvin's book. If not, I've got an idea for an appendix...) Anyway, that led to a complaint about the {microformats_show} custom tag not existing, since it was being used before the frontend_header hook got a chance to define it.

I switched to plan B, but it was just as bad. Turns out that we don't pass $addData by reference, so the hooks can use it, but not modify it. My previous fix had no effect.

So I put everything back the way it was. I made one minor update: when it calls serendipity_smarty_init(), it passes the $addData so $view gets defined (or else it gets the hose again). THEN it goes on to assign all the variables it needs.

I also assigned the tabber.css directly in the header, although I don't see where it ever gets used outside the backend. Still, one less thing for the user to install (README updated).

This was more thoroughly tested, including a brief review on my sandbox to verify that everything would work. It did. Committed. Should be available in 24 hours.

Oh. I only updated the English language files. I'm just too frustrated to go any farther.
Judebert
---
Website | Wishlist | PayPal

User avatar
Don Chambers
Regular
Posts: 3638
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers » Thu Jun 19, 2008 5:59 pm

Thanks Judebert - I downloaded the latest, and it no longer appears to be interfering with $view. I am not actively using the plugin, so I cannot tell you if any of its functionality was adversely affected by your changes.

Anyway, thanks for digging so deeply into this!

User avatar
Don Chambers
Regular
Posts: 3638
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers » Wed Sep 10, 2008 6:22 pm

Something I never noticed before today with the microformats plugin, that may have resulted out of these recent changes:

When editing an entry, then selecting "preview", the preview window seems to want to load the current entry, and an additional one. This additional entry obviously does not exist, and gets an id of something like 0-unknown.

Also, in the advanced options panel for the entry, only after previewing, I get the following error:

Code: Select all

Warning: Invalid argument supplied for foreach() in F:\mypath\plugins\serendipity_event_microformats\serendipity_event_microformats.php on line 137

Warning: Invalid argument supplied for foreach() in F:\mpath\plugins\serendipity_event_microformats\serendipity_event_microformats.php on line 251

Post Reply