Extension talk:Widgets

Jump to: navigation, search

About this board

Old messages are archived.


YouTube widget stops working under https

3
Summary by Kghbln

Update the widget's code to the recent version

Bjohas (talkcontribs)

Hello,

I've recently switched my wiki to https, see e.g. https://bjohas.de/wiki/Google_Docs_Helper_bookmarklet. However, the YouTube widget no longer works. Definitely sure it's to do with https, because if I switch https off, it works again. Of course, it may well not be to do with the widget, but with my overall wiki configuration.

To configure the wiki, I switched the .htaccess file to require https, but didn't change LocalSettings.php. Maybe there's something I missed?

Kghbln (talkcontribs)

Did you update the widget's code page, too. I assume that you are still calling http. Basically do this for every widget you are using.

Bjohas (talkcontribs)

Thank you so much for pointing that out. I must have had some older Widget code, that explicitly used http. The current widget code doesn't do that! Many thanks!

Wmat (talkcontribs)

I'm seeing this PHP Notices recently:

Undefined index: size in ../extensions/Widgets/compiled_templates/ba811dbfd89414d874993a209b5e2eb71ad14d2d.wiki.Google Presentation.php on line 30

Trying to get property of non-object in ./extensions/Widgets/compiled_templates/ba811dbfd89414d874993a209b5e2eb71ad14d2d.wiki.Google Presentation.php on line 30

How can I clean these up?

This post was hidden by 67.171.202.77 (history)
Reply to "Trying to get property of non-object"
Kitsguru (talkcontribs)

I have recently install MediaWiki with the widgets extension (1.3.0). I can't get any widgets to work.

Product Version
MediaWiki 1.29.0
PHP 5.6.31 (litespeed)
MariaDB 10.0.32-MariaDB
ICU 57.1

There is nothing in the error logs or compiled_templates (777) folder.

I have looked through this discussion and google groups but found no solution. I am at a complete lose as to what is happening. Any help is appreciated.

Kitsguru (talkcontribs)

Solved

Zoglun (talkcontribs)

You should post how you solve it. So that others can benefit from your help.

Kristiandelay (talkcontribs)

I am hitting this exact issue what was the fix?

Kristiandelay (talkcontribs)
Zoglun (talkcontribs)

Thank you!

Reply to "widgets not working"
HarryArends (talkcontribs)

I just installed Widgets at my wiki (1.30) and created a widget as described in the manual. so far so good.

But when i save the widget i get a error like this:

Fatal error: Call to undefined method Smarty::addPluginsDir() in /home/harry-arends.nl/public_html/mat54/extensions/Widgets/WidgetRenderer.php on line 30

As I am not a programmer this error says nothing to me so whats going wrong??

Harry & Mareike

Deku-shrub (talkcontribs)

I'm having this problem too. @Jomegat reported the same issue at Topic:U4k1icff0yfhpayl but I wasn't able to reproduce his ' I installed using the git method' workaround so far.

Deku-shrub (talkcontribs)

@Jomegatconfirmed that he got things to work via the Git install method. I got this working too when remembered to not only git clone, but git submodule init and git submodule update as well.

I compared the files installed via Git release from gerrit.wikimedia.org seem are different both in the Widget code and even more so with the latest Smarty release. I'm not sure where to raise this issue, but adding a warning to the zip download pointing here is the best I think I can do for future generations

Gyohza (talkcontribs)

I was able to successfully solve this issue by not installing the version tagged as Smarty's latest release (v2.6.31 as of 2018-03-08). Instead, I installed one earlier version (Release 3.1.31, dated from 2016-12-14, when there weren't complaints of such error), though I haven't figured out why the heck v2 is tagged as being "later" than v3 yet (maybe they're parallel versions and support for v2 is still going on...).

Anyways, just in order to avoid any further issues like this, I will edit @Deku-shrub's warning on Extension:Widgets. I am not going to fully edit the tutorial because they might fix this in the future, so they might as well just remove the warning.

Reply to "addPluginsDir()"
Fokebox (talkcontribs)

Hello all So at my java code there is a line with information which has quotes and should look like this:

data: [
['Value_name', 12.81], ['Value_name2', 11.55], ['Value_name3', 13.50]
]

And at widget page I do it so:

    data: [
<!--{$data|escape:'quotes'}-->
],

and I put the values at wiki pages like this:

{{#widget:Widget_name
|data = ['Value_name', 12.81], ['Value_name2', 11.55], ['Value_name3', 13.50]
}}

And result in HTML look like this:

data: [
[\'Value_name\', 12.81], [\'Value_name2\', 11.55], [\'Value_name3\', 13.50]
]

How to escape the sign "\", because widget doesn't work in this case?

Cavila (talkcontribs)

I can confirm that dumb quotation marks are not handled correctly, or as you would like to, in Smarty. The output shows the escaped \' rather than '. I haven't tested this myself, but Smarty offers a replace function. This link looks relevant: http://www.smarty.net/forums/viewtopic.php?p=50671

Another possible workaround is to use the widget inside a template and make sure that the template replaces each instance with its html equivalent &#39;.

Cavila (talkcontribs)

Belated update (better late than never): the answer is that you should use 'single quotes' not 'quotes'. I made the same mistake about a year ago, based on some old documentation, but then visited the Smarty website and found that the syntax was simply incorrect.

Fokebox (talkcontribs)

I did‘t get what you mean, could you five an example with provided above widget?

Cavila (talkcontribs)

Don't use {$data|escape:'quotes'} but {$data|escape:'single quotes'}. That's all.

Fokebox (talkcontribs)

Thank you, I try

Reply to "How to add data inbetween several quotes"

Utime failed: Permission denied in smarty_internal_template.php on line 182

2
Summary by Kghbln
Zoglun (talkcontribs)

PHP Warning:  touch(): Utime failed: Permission denied in /wiki/extensions/Widgets/smarty/libs/sysplugins/smarty_internal_template.php on line 182

How to fix this?

Kghbln (talkcontribs)

Yeah, I have this all the time, too. I added the respective task to the summary section.

Reply to "Utime failed: Permission denied in smarty_internal_template.php on line 182"
Jomegat (talkcontribs)

I just installed Widgets 1.3.0, but I must have done something wrong. The error log shows this:

[27-Dec-2017 05:40:50 UTC] PHP Fatal error:  Call to undefined method Smarty::addPluginsDir() in /home/investit/public_html/wiki/extensions/Widgets/WidgetRenderer.php on line 30

I downloaded Smarty v2.6.31, and moved its libs directory to extensions/Widgets/smarty/libs. I also chmod'd 777 compiled_templates. Not sure what's missing...

Help? --~~~~

Jomegat (talkcontribs)

Solved. I installed using the git method (I had tried using tar originally).

How to pass Mediawiki images into a widget?

2
178.204.178.14 (talkcontribs)

I tried to display an image in a widget but the code

doesn't seem to work. It just displays [[Image:test.png]] as an alt text. That's all.

Yaron Koren (talkcontribs)

I don't think you can have wikitext within widget code, if that's what you're trying to do. Maybe what you can use is a wrapper template around the widget, that takes in a file name and handles calling both the wikitext and the widget...

Can't get git REL1_29 branch???

4
Summary by Zoglun

git checkout -f -b REL1_29 origin/REL1_29

Zoglun (talkcontribs)

So after

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Widgets.git

I got

 

git branch

  REL1_27
  REL1_28
* master

I did see REL1_29 in

git branch -r

  origin/HEAD -> origin/master
  origin/REL1_19
  origin/REL1_20
  origin/REL1_21
  origin/REL1_22
  origin/REL1_23
  origin/REL1_24
  origin/REL1_25
  origin/REL1_26
  origin/REL1_27
  origin/REL1_28
  origin/REL1_29
  origin/REL1_30
  origin/master
  origin/smarty3

How to get the REL1_29 downloaded to local and switch to it?

Thank you!

MarkAHershberger (talkcontribs)

If you type "git checkout -b REL1_29 origin/REL1_29", you should see the following message:

Branch REL1_29 set up to track remote branch REL1_29 from origin.
Switched to a new branch 'REL1_29'

Something like "git checkout REL1_29" should work, too, as long as REL1_29 is on origin and it doesn't show up on the output of "git branch".

MarkAHershberger (talkcontribs)

oh, and you may want to checkout submodules for that extension:

git submodule update --init
Zoglun (talkcontribs)

git checkout -f -b REL1_29 origin/REL1_29

Internal error adding widget to page

4
Summary by Kghbln

Upgrade to version 1.3.0

Henryfunk (talkcontribs)

When I add a widget to a page I get an Internal error:

[e9d3c35de62dbbc78dc0c67d] /wiki/index.php?title=Test&action=submit Error from line 176 of /var/www/html/wiki/extensions/Widgets/WidgetRenderer.php: Call to undefined method Article::getContent()

My configuration:

  • Widgets 1.2.1
  • Smarty 3.1.30
  • MediaWiki 1.29.1
  • PHP 7.0.22-0ubuntu0.16.04.1 (apache2handler)
  • MySQL 5.7.19-0ubuntu0.16.04.1
  • Article path /wiki/index.php/$1
  • Script path /wiki
  • index.php /wiki/index.php
  • api.php /wiki/api.php
  • load.php /wiki/load.php

The Widgets extension is listed under Installed Extensions on Special:Version, and I can create pages in the Widgets namespace without any errors.

I believe I have installed everything correctly (manual installation). Owner of extensions/Widgets is www-data:www-data . Owner and group permissions on extensions/Widgets and all its sub-folders are Read-Write-Execute. I have put the libs folder with contents into extensions/Widgets/smarty/ .

I will add backtrace here if needed.

Any suggestions would be much appreciated.

Kghbln (talkcontribs)

Upgrade to 1.3.0 and let's see how it goes.

Henryfunk (talkcontribs)

Now that was an easy fix! Thank you very much. I simply clicked the link in the "Installing from a .zip file" section and that link hadn't been updated to point to 1.3.0. I have now done so.

Kghbln (talkcontribs)

Cool that it works now. This was indeed a "bad" link. I further changed the links to make them less version dependent.