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

The wrong mediasource is selected when updating a static element #13750

Closed
Oetzie opened this Issue Feb 6, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@Oetzie
Contributor

Oetzie commented Feb 6, 2018

Summary

The wrong mediasource is selected when updating a static element.

Step to reproduce

Make an static element with a custom mediasource and save the static element. After saving and refreshing the window the wrong mediasource (default mediasource) is selected for the element.

Observed behavior

The mediasource of the 'static_file' is set by a listener on the 'mediasource' field. But when you update a static element you don't change the mediasource so the listener wont be fired.

Expected behavior

Add the following line to the config of the 'static_file' field for each element panel (plugins, chunks, templates, snippets). With this line the mediasource will be set to the record or the default mediasource on the page load and not only with a listener on the 'mediasource' field.

,source: config.record.source != null ? config.record.source : MODx.config.default_media_source

This can be fix with this pull request: #13646

Environment

All MODX versions

@Oetzie

This comment has been minimized.

Contributor

Oetzie commented Feb 9, 2018

I'm going to try and fix this today #modxbughunt

Mark-H added a commit that referenced this issue Feb 9, 2018

Fix selecting the right media source when editing a static element [#…
…13750]

Merge remote-tracking branch 'upstream/pr/13762' into 2.6.x

* upstream/pr/13762:
  Test template deleted
  Static file mediasource fix
@Mark-H

This comment has been minimized.

Collaborator

Mark-H commented Feb 9, 2018

Fixed per #13762 in 2.6.2

@Mark-H Mark-H closed this Feb 9, 2018

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