-
Notifications
You must be signed in to change notification settings - Fork 908
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] In Relationship field nested subfields doesn't work #5761
Comments
Hello there! Thanks for opening your first issue on this repo! Just a heads-up: Here at Backpack we use GitHub Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that. Backpack communication channels:
Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. Thank you! -- |
Based on the information provided in your bug report, it appears you're experiencing an issue with nested subfields in a Relationship field in Backpack. This is indeed a known limitation in Backpack. The current implementation of the Relationship field in Backpack does not fully support nested subfields, especially when one of the subfields is another relationship field with its own subfields. This limitation is documented in several GitHub issues for the Backpack CRUD repository. For example, in Github Issue #4109, there's a comprehensive discussion about which field types work as subfields inside relationship fields. The issue notes that not all field types are fully supported as subfields, and there can be unexpected behavior or errors when using complex nested structures. The error you're seeing ("Uncaught SyntaxError: "undefined" is not valid JSON") suggests that there might be a problem with how the nested data is being processed or rendered in the JavaScript layer of the Backpack interface. Unfortunately, the knowledge sources don't provide a direct solution for this specific issue. However, here are a few suggestions based on similar issues:
If you need further assistance, I'd recommend opening a new issue on the Backpack CRUD GitHub repository with a detailed description of your field structure and a minimal code example that reproduces the issue. This will allow the Backpack team to investigate and potentially provide a more specific solution. ℹ️ 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): [Bug] Backpack does not guess attributes in |
Bug report
Please note: All issues must be submitted in English. If not, they will be closed automatically.
What I did
I've defined an HasMany relationship between fields where one of them is another relationship field with subfields
What I expected to happen
It should show subfields
What happened
Uncaught SyntaxError: "undefined" is not valid JSON
What I've already tried to fix it
Actually nothing
Is it a bug in the latest version of Backpack?
Yes
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:PHP VERSION:
8.4.1
PHP EXTENSIONS:
Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, json, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, intl, SPL, ldap, mbstring, session, standard, mysqlnd, mysqli, odbc, pcntl, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, random, readline, Reflection, exif, shmop, SimpleXML, snmp, soap, sockets, sodium, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, xdebug, Zend OPcache
LARAVEL VERSION:
11.37.0.0
BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.3.6
backpack/calendar-operation: 1.0.12
backpack/crud: 6.7.45
backpack/generators: v4.0.7
backpack/permissionmanager: 7.2.1
backpack/pro: 2.2.30
backpack/theme-coreuiv4: 1.1.5
Additional Information
Here's some more info that could be helpful in reproducing or debugging:
Note: Issues that cannot be reproduced or lack necessary details to diagnose could be closed.
The text was updated successfully, but these errors were encountered: