Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WE-Framework does not work with Vector2022 #104

Open
Seudo3 opened this issue Feb 16, 2023 · 2 comments
Open

WE-Framework does not work with Vector2022 #104

Seudo3 opened this issue Feb 16, 2023 · 2 comments

Comments

@Seudo3
Copy link

Seudo3 commented Feb 16, 2023

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
Copy link
Author

Seudo3 commented Feb 16, 2023

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.

@nkomarov
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants