Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Module Configuration not working without SCRIPT_DEBUG #205

Closed
kraftner opened this issue May 9, 2016 · 5 comments
Closed

Module Configuration not working without SCRIPT_DEBUG #205

kraftner opened this issue May 9, 2016 · 5 comments
Assignees
Milestone

Comments

@kraftner
Copy link
Contributor

kraftner commented May 9, 2016

Version Information

  • WordPress: 4.4.3
  • MultilingualPress: 2.4.0

Steps to Reproduce

  1. Open Apperance/Menus
  2. Click "Add to Menu"
  3. Nothing happens

What I Expected

a language menu item being added.

What Happened Instead

Nothing


When I define('SCRIPT_DEBUG', true); it works. Also Firefox Developer Toolbar confirms there are no listeners attached without SCRIPT_DEBUG. Unfortunately debugging in the minified file (without source maps) is hard so I have no clue where the issue lies for now.

@kraftner
Copy link
Contributor Author

kraftner commented May 9, 2016

Okay there seems to be something wrong with the compiled version of functions.js

I think the issue is that building the name of the config variable from the module name doesn't work as it may be changed during minification.

@kraftner kraftner changed the title Language Menu Item (NavMenus) not working without SCRIPT_DEBUG Module Configuration not working without SCRIPT_DEBUG May 9, 2016
@kraftner
Copy link
Contributor Author

kraftner commented May 9, 2016

Okay the issue seems to be bigger than I thought. This doesn't only affect the NavMenu module but any module that has configuration settings.

Here is another example: When changing a relation and saving the post without first saving the relation change there is an error (Uncaught TypeError: Cannot read property 'unsavedRelationships' of undefined) and the modal warning about lost data doesn't show up.

@kraftner
Copy link
Contributor Author

kraftner commented May 9, 2016

Okay I think I've got it. function.name is changed on minification. This approach feels fragile in any case.
This doesn't behave as expected when minified.

@tfrommen
Copy link
Member

tfrommen commented May 9, 2016

@kraftner thanks for the issue as well as your investigative work.

I already fixed this, so you may expect a patch release really soon.

@kraftner
Copy link
Contributor Author

kraftner commented May 9, 2016

Cool. Just tested on master, all working now. Thanks for the extremely fast response!

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

No branches or pull requests

2 participants