User tests: Successful: Unsuccessful:
Right now, the method JTableNested::rebuild() can not be called from a JTableAsset object, because JTableNested::rebuild() expects the table to have a column named 'alias'. This prevents that table from being repaired. This PR implements a specific method for this table that does not need the alias column.
Not being able to repair this table is a big issue, since the permissions system might be borked with this. The specific example is a large JoomGallery installation with ~20k images. Each of these images has an entry in the assets table. Somehow the categories got messed up and several thousand images were not assigned to a correct parent item in the assets table. This meant that no normal user was able to edit his own images. With some SQL queries I was able to fix the images to their right category, but that still meant that the lft and rgt values were wrong and thus the queries would still result in wrong results. Calling JTableAsset::rebuild() would normally fix that, but a) there is no way to do that from the GUI and b) the method from JTableNested failed.
Put JTable::getInstance('Asset')->rebuild();
somewhere in for example a layout of yours and open the page with that layout. See that it fails fatally. Apply the patch. See that it works now. Also see that the assets table has been rebuild.
Maybe we should add this to the "fix database" button in the extension manager.
Labels |
Added:
?
|
Category | ⇒ | Libraries |
I have tested this item successfully on e84377f
Test OK
Milestone |
Added: |
||
Status | Pending | ⇒ | Ready to Commit |
Milestone |
Added: |
RTC. Thanks. @committer can you update the @since
tag to 3.5
on merge? If not i can send a pull for it if needed and this is merged.
Labels |
Added:
?
|
This PR has received new commits.
CC: @anibalsanchez, @chmst
There you go
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-11-08 18:11:25 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
@test - success
Before patch: Unknown column 'alias' in 'field list' SQL=SELECT id, alias FROM cbf3_assets WHERE parent_id = 1 ORDER BY parent_id, lft
After the patch: no error
Data in lft and rgt columns not checked
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6307.