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

Configuration works on new entries, but not on existing entries #54

Closed
brettburwell opened this issue Apr 1, 2019 · 8 comments
Closed
Assignees
Labels
Bug Report Something isn't working

Comments

@brettburwell
Copy link

We're seeing an issue where our Spoon configuration works properly on new entries, but isn't being applied when viewing existing entries.

While trying to debug the issue I noticed something unexpected happen that might provide a clue about what's going on.

As a test, I uninstalled and reinstalled Spoon and tried rebuilding the configuration from scratch (to see if that might resolve the issue). First, I did a quick check by adding a few blocks into a few groups to see if things were working as expecting.

In my initial test all seemed well. That configuration was working on new and existing entries.

Then I went back and updated the configuration (to more closely match the setup we have in our production environment). When I did this I immediately bumped into the same bug. Although I noticed that new entries were using the updated configuration, but existing entries were somehow referencing the original configuration (from the first test, where I added a few blocks to a few groups) [screen shots of both configurations are pasted below].

So from what I can gather, it looks like Spoon is somehow not referencing the updated field configuration consistently.

Below is a bit more detail. Please let me know if I can pass along any additional information that might be helpful.

Some background details on the site + configuration

  • All of the configuration is being done at the contextual / field layout level. We have no global layouts defined.
  • This is a multisite install that's currently running three different sites.
  • The field we're having trouble is configured to Manage blocks on a per-site basis.
  • The site is running Craft 3.0.36 and Spoon 3.2.4. We're not able to update production yet, but to ensure this wasn't fixed in a recent release, we updated to Craft 3.1.x and the latest release of Spoon locally and are seeing the same issue.
  • When I open up dev tools I see a Double-instantiating a menu button on an element (garnish.js:220) message 4 times when viewing an existing entry. I see the same message, but only twice when creating a new entry.

Screen shot of the updated configuration (taken when first creating the test entry)

spoon-configuration2

Screen shot of test configuration (taken after saving the test entry)

sppon-configuration1

@joshangell joshangell self-assigned this Apr 3, 2019
@joshangell
Copy link
Contributor

joshangell commented Apr 3, 2019

Aha, interesting, I suspect this is to do with that Manage blocks on a per-site basis setting, I will investigate! In case it helps, could you send me a db and composer.json to josh@angell.io, thanks!

@joshangell joshangell added the Bug Report Something isn't working label Apr 3, 2019
@brettburwell
Copy link
Author

Thanks for the quick response @joshangell. I just shot an email over way. Let me know if there's any additional info that'd be helpful to pass along.

@joshangell
Copy link
Contributor

OK, a note on the exact reproduction of this:

  • Must be multi site
  • Must have Manage blocks on a per-site basis set to on
  • New entries work fine across sites
  • Existing entries lose configuration on anything other than the primary site

Almost certainly to do with the URL matching for loading configs.

joshangell added a commit that referenced this issue Apr 5, 2019
- Qualified the Loader count() calls for opcode speed improvements

- Fixed an issue with the configurations not being loaded on existing entries for non-default sites ([#54](#54))
- Fixed an issue where the global block types settings page would still show deleted global configs if there was a global set with a contextual config for that field

* tag '3.3.6':
  Changelog for 3.3.6
@joshangell
Copy link
Contributor

@brettburwell done! Give it a whirl :)

@brettburwell
Copy link
Author

You're a champ. Thanks for so quickly digging into that one. We'll give it a look today!

@joshangell
Copy link
Contributor

No worries!

@brettburwell
Copy link
Author

Howdy @joshangell. Just wanted to confirm that the fix looks good on this end. Thanks again!

@joshangell
Copy link
Contributor

joshangell commented Apr 8, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants