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

Module Configuration not working without SCRIPT_DEBUG #205

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

Comments

2 participants
@kraftner
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

This comment has been minimized.

Show comment
Hide comment
@kraftner

kraftner May 9, 2016

Contributor

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.

Contributor

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 from Language Menu Item (NavMenus) not working without SCRIPT_DEBUG to Module Configuration not working without SCRIPT_DEBUG May 9, 2016

@kraftner

This comment has been minimized.

Show comment
Hide comment
@kraftner

kraftner May 9, 2016

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@kraftner

kraftner May 9, 2016

Contributor

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.

Contributor

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 tfrommen added this to the v2.4.1 milestone May 9, 2016

@tfrommen tfrommen self-assigned this May 9, 2016

@tfrommen tfrommen closed this in decc542 May 9, 2016

@tfrommen

This comment has been minimized.

Show comment
Hide comment
@tfrommen

tfrommen May 9, 2016

Contributor

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

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@kraftner

kraftner May 9, 2016

Contributor

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

Contributor

kraftner commented May 9, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment