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

Blueprint fixes #4298

Merged
merged 5 commits into from
Sep 23, 2021
Merged

Blueprint fixes #4298

merged 5 commits into from
Sep 23, 2021

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Sep 22, 2021

Resolves #2144 by fixing an incompatible config array being passed along to reference fields.

We build an array of the field's configs, and when you click a field, that array gets passed up to the server via ajax.
It's preProcessed on the server. The error was happening because we preprocessed it twice - once when building the initial array, and again when it's passed up to the server. Once upon a time, we may have needed it processed up front but looks like it hung around unintentionally when we changed the approach.

The issue was in toBlueprintArray() - it was only used in the core in two spots:

  • One of them was in an old unused controller, so I deleted that as well as the related fieldtype.
  • The array mentioned above. Instead of using toBlueprintArray, I just inlined the appropriate keys needed. It was passing in more than necessary anyway.

The name toBlueprintArray is unintuitive, so I've deprecated it and just left it alone. Anyone using it (I only see one non-core use on all of GitHub, by @duncanmcclean).

@jasonvarga jasonvarga changed the title Blueprint Blueprint fixes Sep 22, 2021
@jasonvarga jasonvarga merged commit ed98ff5 into 3.2 Sep 23, 2021
@jasonvarga jasonvarga deleted the fix/2144-blueprint-stuff branch September 23, 2021 14:21
duncanmcclean added a commit to duncanmcclean/simple-commerce that referenced this pull request Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot add related field to blueprint
1 participant