Widget Errors

Jump to: navigation, search

Hi, I installed the Widgets extension and then created the page Widget:YouTube and put {{#widget:YouTube|id=NAal5r_qEQY}} on this page, but nothing shows up on the page. I have been trying to trouble shoot the problem for a while, but haven't been able to seem to figure out the problem yet.

I'm using MW 1.17 and have set the permissions for compiled_templates to 666 . Any advice on what steps I can take would be much appreciated.

ForestForTrees820:27, 30 November 2011

Did you check log files? do they show any errors?

Sergey Chernyshev02:33, 1 December 2011

Thanks for getting back to me. I checked the log files and they didn't show any errors. I'm not sure if it really matters, but when I remove the # from {{#widget:....}} the code from Widget:YouTube appears on the page. The code is

<object width="" height=""><param name="movie" value="http://www.youtube.com/v/"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/" type="application/x-shockwave-flash" wmode="transparent" width="" height=""></embed></object>

When I leave the # in the code nothing shows up on the page. It is pretty weird. Have any other ideas?

ForestForTrees816:00, 1 December 2011

That's expected. Everything you see see there is stuff that normally would be transcluded by normal transclusion. But the #widget tag is the one that's supposed to make it actually work.

Reach Out to the Truth17:11, 1 December 2011
 

Thanks again for both of your help. I'm very eager to get this working, so I poked around the PHP code a little bit. I was wondering if you might be able to help me interpret what I found.

In wiki_get_template, the line

$widgetCode = $widgetArticle->getContent();

is returning the content of the YouTube widget. This seems like a good sign in that Smarty is able to access the wiki template.

However, in renderWidget, when I inserted the code,

echo "<-- renderWidget afteroutput=$output-->"; 

right after

$output = 'ENCODED_CONTENT '.base64_encode($output).' END_ENCODED_CONTENT';,

the resulting HTML included <-- renderWidget afteroutput=ENCODED_CONTENT END_ENCODED_CONTENT-->

In other words, the content of the widget seems to get completely lost by the end of renderWidget. Somehow, it looks like fetch() isn't working quite right.

You can view this for yourself at the following page: http://tmswiki.medialayer.net/w/index.php?title=Scratch_pad&action=purge Because the wiki is being used and I didn't want to leave any detritus around, I added a '!' right after the '<' in the following line

echo "<-- renderWidget afteroutput=$output-->"; 

Doing so turned the output into an HTML comment, so it can only be seen if you look at the source.

ForestForTrees821:34, 1 December 2011
 

Thanks for your help. I think that this must have been user error. I uninstalled and very carefully reinstalled and everything is working perfectly.

ForestForTrees820:30, 6 December 2011

Glad to hear that it worked in the end! Enjoy!

Sergey Chernyshev00:29, 7 December 2011
 
 
Personal tools

Variants
Actions
Navigation
Support
Download
Development
Communication
Toolbox