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

[Bug] select2_json_from_api load values #5743

Closed
adriallongarriu opened this issue Jan 7, 2025 · 3 comments
Closed

[Bug] select2_json_from_api load values #5743

adriallongarriu opened this issue Jan 7, 2025 · 3 comments
Labels

Comments

@adriallongarriu
Copy link
Contributor

Bug report

Releted to the issue #5557 the changes on Backpack/Pro 2.2.29 create a new issue. When you reload the form because a required field or you try to edit the field is empty. Is using the wrong variable name.

I commented 3 weeks ago. I'm creating this issue for follow-up so it doesn't get forgotten.
Comment with all the info:
#5557 (comment)

Is it a bug in the latest version of Backpack?

Yes, in the last version 2.2.30

Copy link

🚨 Bot is not sure about this answer. Please verify. 🚨

Based on the information provided in the knowledge sources, I can address this issue related to the select2_json_from_api field in Backpack.

The user is reporting a bug where the select2_json_from_api field doesn't load values correctly when the form is reloaded or when trying to edit an entry. This issue seems to be related to a previous problem discussed in Github Issue #5557.

According to the original issue, there was a problem with how the select2_json_from_api field behaved when the form was reloaded. Specifically, the stored value format changed from a single JSON object to an array containing that object when the form was reloaded due to a validation error.

The user mentions that this new issue appeared after changes in Backpack/Pro version 2.2.29 and is still present in version 2.2.30. They state that the field is now empty when reloading the form or trying to edit an entry, suggesting that the field is not properly retrieving the stored value.

Unfortunately, the knowledge sources don't provide specific information about changes in versions 2.2.29 or 2.2.30 that might have caused this new behavior. Additionally, there's no direct solution provided for this specific issue in the available documents.

Given the limited information in the knowledge sources about this particular problem, I cannot provide a definitive solution or explanation for why this is happening. It appears to be a new bug that has not been fully documented or addressed in the provided information.

To properly address this issue, it would be advisable to:

  1. Create a new GitHub issue in the Backpack repository detailing the problem, including steps to reproduce, expected behavior, and actual behavior.
  2. Provide code samples of how the field is implemented in your project.
  3. Include information about your environment, such as Laravel version, PHP version, and the exact Backpack package versions you're using.

This will allow the Backpack maintainers to investigate the issue more thoroughly and potentially provide a fix in a future update.

ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️

Relevant sources:

Github Issue (open): select2_json_from_api behaviour when form is reloaded
Github Issue (closed): select2_json_from_api wrong attribute to store behaviour
Github Issue (closed): [Bug] select2_from_array field with 0 value resets if an request error
Github Issue (closed): [Bug] select_from_array does not pre-select old values during editing
Github Issue (closed): select2_from_ajax does not show the field value when update ( with entity => false )
Github Issue (closed): select2 multiple doesn't keep old data when submit form
Github Issue (closed): display translatable field in select2_from_ajax
Github Issue (closed): [Bug] Error in repeatable Field "Uncaught TypeError: Cannot read properties of undefined (reading 'subfieldsCallbacks')"
Github Issue (closed): [Bug] Values function in fluent API not working
Github Issue (closed): [Bug] select2_from_ajax doesn't ever call the function to fetch data
Github Issue (closed): [Bug] Select2 Filter Does Not Trigger a Change

@jcastroa87
Copy link
Member

Hello @adriallongarriu can you share the controller field to replicate the issue in my side.

Cheers.

@pxpm
Copy link
Contributor

pxpm commented Jan 8, 2025

Thanks @adriallongarriu, and sorry I missed it. On it 👍

Fixed in 2.2.31, a composer update should get you the new version after our private repository pick up the changes 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

3 participants