Admin Fields view not loading #1010
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1010
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
Opening of the admin fields view, either via the Admin view Edit button or via the list button.
Expected result
To be able to edit the list of fields related to that view
Actual result
Getting the following Error
Call Stack in attached picture.
I have tried to debug on my own tracing back the call stack, I have not been able to determing why the $content variable is empty in
JROOT\administrator\components\com_componentbuilder\models\fields\fields.php:54
being line 54
$field_name = ComponentbuilderHelper::safeFieldName(ComponentbuilderHelper::getBetween(json_decode($item->xml),'name="','"'));
database is working properly and the json stored data is not corrupt.
This happens to any Admin view realeted admin fields view.
System information (as much as possible)
Additional comments
In admin wiew, the list showing the fields of that view is working properly, so far I have been able to work arround this issue by editing the parameters in the db itself.
Please make sure to use Firefox for JCB development, and try the last beta-update from today.
Hello @Llewellyn Apply suggestions, and I´m still getting this problem, and I haven't been able to catch with var_dump the null parameter given, any ideas How can I get it?
Hmm to try and see when this is happening is hard. The class in question is: GetHelper::between(...)
As you can see its looking for
@param string $content The content to search
and since null is given its falling over. To avoid the error remove thestring
data type from$content
. So while this will work, it essentially means there is data in your component that should be a string but is a null, this is normally related to a field.So the function should look like:
From:
to:
You see this line is trying to load the xml value of your fields:
And since the field probably does not have a value it returns null.
This issue has come up a few times, and in the end it gets resolved by building complete views, full fields... as empty things are currently not being anticipated in JCB.
The fix for this particular issue could be to add a if statement to the
getOptions
:I have added this fix to the beta-branch a few minutes ago... let me know.
Thank you @Llewellyn the fix has worked,
You mention an empty field is most probable the reason why it is happening, I wonder why then, it was happening to all my admin field views, If I find where this empty field is occurring I´ll let you know.
Thanks.