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

Opening Edit-form as modal not working for links created by the module #8

Closed
patrickkaleta opened this issue May 9, 2019 · 2 comments
Assignees
Labels
BB: UI Integration Platform UI Integration Platform Building Block bug Something isn't working enhancement New feature or request

Comments

@patrickkaleta
Copy link
Contributor

The openEditForm function creates a link just like the ones on the Summary-Tab, which open the edit-forms for Report Images via Ajax as a modal.

However, this doesn't seem to work and the "use-ajax" class in the link gets ignored and a complete page-load is triggered instead. Not a major bug, since the user is taken back to the correct page after he/she saves the edit-form. But it's still ugly that way.

@fgeyer16 Any idea why this is not working?

@patrickkaleta patrickkaleta added bug Something isn't working enhancement New feature or request labels May 9, 2019
@fgeyer16
Copy link

fgeyer16 commented May 9, 2019

After creating the link, it is just a link in the html. The popup functionality is added to the use-ajax links by js after loading the document. SInce the document is already loaded, the additional onclick handler is not added to the link.
If drupal does not make an exception from its own recommendations to use behaviors I think this could fix it:
add
Drupal.attachBehaviors(link, Drupal.settings);
after completing its creation. Then the popup stuff should be added. Theoretically you do not need to attach all behaviors to that link, but only the right ones. But this needs some very deep research into drupal ;-)

@patrickkaleta
Copy link
Contributor Author

@fgeyer16 thanks, this fixed the problem. Now it's working as expected :-)

@p-a-s-c-a-l p-a-s-c-a-l added this to Backlog: High Priority in T1.3 Climate Services Co-creation via automation Oct 28, 2019
@p-a-s-c-a-l p-a-s-c-a-l added this to To do in T1.4 Industrialization and Support via automation Oct 28, 2019
@p-a-s-c-a-l p-a-s-c-a-l added the BB: UI Integration Platform UI Integration Platform Building Block label Oct 28, 2019
@p-a-s-c-a-l p-a-s-c-a-l added this to the D1.3 CLARITY CSIS v1 milestone Oct 28, 2019
@p-a-s-c-a-l p-a-s-c-a-l moved this from Backlog: High Priority to Done in T1.3 Climate Services Co-creation Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BB: UI Integration Platform UI Integration Platform Building Block bug Something isn't working enhancement New feature or request
Development

No branches or pull requests

3 participants