WE-Framework icon indicating copy to clipboard operation
WE-Framework copied to clipboard

WE-Framework does not work with Vector2022

Open Seudo3 opened this issue 2 years ago • 3 comments

When using the Vector2022 (which is the default), the gadgets do not appear any more. The following error appears in the browser console:

[WE-F] all WEF modules were loaded Successfully open indexedDB connection for database PROPERTYDATA index.php:2:924408 Successfully open indexedDB connection for database STRINGPROPERTYVALUES index.php:2:924408 Successfully open indexedDB connection for database WEF_EXTERNAL_ID_LRU index.php:2:1036387 Successfully open indexedDB connection for database PARENTTYPES index.php:2:924408 Successfully open indexedDB connection for database PROPERTIESBYSPARQL index.php:2:924408 Exception in load-callback: load.php:1:852 Error: Unable to locate 'p-wef-label' ID on the page. Looks like site navigation menu is changed in a way that can't be modifid from JS https://ru.wikipedia.org/w/index.php?title=User:Vlsergey/wef.js&action=raw&ctype=text/javascript:2 jQuery 3 using https://fr.wikisource.org/wiki/Les_Phoinissiennes line 10 > injectedScript:516 doPropagation https://fr.wikisource.org/w/load.php?lang=fr&modules=startup&only=scripts&raw=1&skin=vector-2022:6 load.php:1:871

This is probably linked to a recent change in Vector-2022 (https://phabricator.wikimedia.org/T328692).

Seudo3 avatar Feb 16 '23 08:02 Seudo3

If I understand correctly how WEF works:

  • the Javascript code creates the WEF menu by cloning a DOM element with id p-tb (a "Tools" menu)
  • inside that cloned element, all IDs are modified by replacing p-tb-xxx with p-pef-xxx
  • it assumes that the p-tb element contains an element with id p-tb-label, which becomes p-pef-label in the cloned version
  • however, Vector-2022 still contains a p-tb element (now on the right part of the page), but that element does not include a p-tb-label element any more. Therefore WEF cannot be loaded.

Therefore the Javascript code should be modified, so that it does not depend upon this id any more.

Seudo3 avatar Feb 16 '23 08:02 Seudo3

The issue is still open. Vector-2022 will become standard soon so this fix would help a lot!

nkomarov avatar Jan 16 '24 09:01 nkomarov

Since WE-Framework does not seem to be maintained any more, my workaround is to add ?useskin=vector in the URL when I want to use it... but other things do not seem to work well, even with the old Vector.

Seudo3 avatar Jul 23 '24 07:07 Seudo3