Admin view edit hung up #71

Closed
opened 2017-04-24 20:57:58 +00:00 by JohnnyMcWeed · 5 comments
JohnnyMcWeed commented 2017-04-24 20:57:58 +00:00 (Migrated from github.com)

Since I updated to the actual version, I can do the following procedure and the component builder doesn't work anymore:

  • Make a new admin view
  • Save the admin view
  • Open it again to edit

It then starts to load, but never finish. (Only for newly created admin views)
J: 3.6.5 CB: 2.4.3 PHP: 5.6.26

Console error tells this:

Uncaught TypeError: Cannot read property 'length' of undefined
    at e.JRepeatable.a.$input.data.a.buildRows (repeatable.js:6)
    at e.JRepeatable.a.$input.data.a.init (repeatable.js:6)
    at new e.JRepeatable (repeatable.js:6)
    at HTMLInputElement.<anonymous> (repeatable.js:6)
    at Function.each (jquery.min.js:2)
    at a.fn.init.each (jquery.min.js:2)
    at a.fn.init.e.fn.JRepeatable (repeatable.js:6)
    at repeatable.js:6
    at dispatch (jquery.min.js:3)
    at r.handle (jquery.min.js:3)
Since I updated to the actual version, I can do the following procedure and the component builder doesn't work anymore: - Make a new admin view - Save the admin view - Open it again to edit It then starts to load, but never finish. (Only for newly created admin views) J: 3.6.5 CB: 2.4.3 PHP: 5.6.26 Console error tells this: ``` Uncaught TypeError: Cannot read property 'length' of undefined at e.JRepeatable.a.$input.data.a.buildRows (repeatable.js:6) at e.JRepeatable.a.$input.data.a.init (repeatable.js:6) at new e.JRepeatable (repeatable.js:6) at HTMLInputElement.<anonymous> (repeatable.js:6) at Function.each (jquery.min.js:2) at a.fn.init.each (jquery.min.js:2) at a.fn.init.e.fn.JRepeatable (repeatable.js:6) at repeatable.js:6 at dispatch (jquery.min.js:3) at r.handle (jquery.min.js:3) ```

I am not getting the same error on my side. Lets see.... hmmm

The JRepeatable function is a Joomla core function. I wonder if it will help to reinstall Joomla... not sure, but worth a try. Not a full reinstall, just to download the full Joomla 3.6.5 package and unzip it in your root folder and so override all files that are part of the core. Then simply delete the install folder, since no need to reinstall the DB again, this is not a DB error from what I can see in your console error.

Once you have done that, please download the latest JCB 2.4.3 as well and reinstall it just for good measure.

Now we are sure everything should be correct in terms of the core and the JCB component. Then do another test and let me know if that helped.

Honestly I have never seen this kind of error, and so I would say search your environment to insure that all is setup correctly. Check that all Joomla requirements are met. I suppose you have done that already, and that most of what I said my seem like an insult.

But please take my advice, I have often found that the smallest thing can cause major issues, and so double checking things is second nature in my DEV world...lol

I realize you said that things did work, until the upgrade, so if all the above remains fruitless. We have few options really, you can give me access to the server, and let me try and debug this. Second you try with a new fresh install of Joomla and JCB. You can also try to go back to the OLD version that worked.

Hey, just thought of something else, it could be that the database has a mismatch, so check that the database has the same fields as seen in this file on line 129 to 255. This is the full table structure of the admin views. IF any of the fields are missing, it could also cause this kind of behavior. Should you find a missing field, simply add it to the database and you should be good to go, if you need any help with that let me know.

Sorry that I can't be of more help, but if I can't see it, it is very hard to fix.

I am not getting the same error on my side. Lets see.... hmmm The **JRepeatable** function is a Joomla core function. I wonder if it will help to reinstall Joomla... not sure, but worth a try. Not a full reinstall, just to download the full Joomla 3.6.5 package and unzip it in your root folder and so override all files that are part of the core. Then simply delete the install folder, since no need to reinstall the DB again, this is not a DB error from what I can see in your console error. Once you have done that, please download the latest [JCB 2.4.3](https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.4.3/JCB_v2.4.3.zip) as well and reinstall it just for good measure. Now we are sure everything should be correct in terms of the core and the JCB component. Then do another test and let me know if that helped. Honestly I have never seen this kind of error, and so I would say search your environment to insure that all is setup correctly. Check that all Joomla requirements are met. I suppose you have done that already, and that most of what I said my seem like an insult. But please take my advice, I have often found that the smallest thing can cause major issues, and so double checking things is second nature in my DEV world...lol I realize you said that things did work, until the upgrade, so if all the above remains fruitless. We have few options really, you can give me access to the server, and let me try and debug this. Second you try with a new fresh install of Joomla and JCB. You can also try to go back to the OLD version that worked. Hey, just thought of something else, it could be that the database has a mismatch, so check that the database has the same fields as seen in [this file](https://github.com/vdm-io/Joomla-Component-Builder/blob/master/admin/sql/install.mysql.utf8.sql#L129) on line 129 to 255. This is the full table structure of the admin views. IF any of the fields are missing, it could also cause this kind of behavior. Should you find a missing field, simply add it to the database and you should be good to go, if you need any help with that let me know. Sorry that I can't be of more help, but if I can't see it, it is very hard to fix.
Peeripapo commented 2017-04-24 22:46:21 +00:00 (Migrated from github.com)

This happened to me last week. I think this happens when you save an admin view with no fields set.

This happened to me last week. I think this happens when you save an admin view with no fields set.

hmmm okay, this is a bug. But not sure who can fix it... weired really. I mean there is no values like when creating a new view. and yet the repeatable field is broken for fields

@JohnnyMcWeed it seems my answer above is not going to help. So at this time when you create an admin view, add at least one field. This should work, while we work to find the fix.

Thanks!

hmmm okay, this is a bug. But not sure who can fix it... weired really. I mean there is no values like when creating a new view. and yet the repeatable field is broken for **fields** @JohnnyMcWeed it seems my answer above is not going to help. So at this time when you create an admin view, add at least one field. This should work, while we work to find the fix. Thanks!

@Peeripapo amazing, I found it!

That script we added to sort the fields, causes a malformed json object to be saved since it is empty. So when I removed the [] from the addfields column the view loaded again and I could edit the fields. Yet if saved, it once again adds the [] if no fields were selected. So we need to insure that the fields only get sorted if there is actualy fields set, so we don't endup storing a malformed json string.

@JohnnyMcWeed this will soon be fixed 👍

@Peeripapo amazing, I found it! That script we added to sort the fields, causes a malformed json object to be saved since it is empty. So when I removed the `[]` from the **addfields** column the view loaded again and I could edit the fields. Yet if saved, it once again adds the `[]` if no fields were selected. So we need to insure that the fields only get sorted if there is actualy fields set, so we don't endup storing a malformed json string. @JohnnyMcWeed this will soon be fixed :+1:
Peeripapo commented 2017-04-25 09:35:22 +00:00 (Migrated from github.com)

@Llewellynvdm Nice one! Good job on that debugging :)

@Llewellynvdm Nice one! Good job on that debugging :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joomla/Component-Builder#71