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
Access level delete, add tables names #39654
Conversation
Nice idea. Not sure that the message is much more useful though as the table names are not very helpful. They give a clue to developers and those that speak english but otherwise they are pretty meaningless. Can it not display the component name? And cant see any benefit at all in displaying the id |
@brianteeman totally agree with you. It is only useful for developers (I had to dive into the database when I wanted to delete an access level. But I have no idea where to get he component. In Joomla I could use some hard coded table, but not for 3rd party extensions. Every suggestion is appreciated. Also agree with the id, will remove it from the message. |
I have tested this item ✅ successfully on 7832067 Still not sure how useful it is This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39654. |
I have tested this item 🔴 unsuccessfully on 7832067 Still not sure how useful it is This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39654. |
Steps to reproduce the issueCreate three access levels (1,2,3) Test 1Select all three access and try to delete them Expected resultLevel 1 is deleted and an error message that I cannot delete 2 and 3 because they are in use Actual resultCall stack
|
Thanks for testing - if more than one levels are to be deleted, it needs further work. This was already a bug before. Will change this PR to draft now. |
@chmst I created an issue for the multiple delete information |
This needs to be resolved first (or together) #39654 |
Co-authored-by: ReLater <ReLater@users.noreply.github.com>
Co-authored-by: Quy <quy@nomonkeybiz.com>
Another related issue is that you can save a view access level without assigning any user groups. In the case of the "special" level this will result in the admin of your site missing all the menus and toolbars and can only recovered by6 editing the database directly. |
This pull request has been automatically rebased to 5.0-dev. No new features will be merged into Joomla! 4.3 series. Joomla! 4.4 series is a bridge release to make migration from Joomla! 4 to 5 as smooth as possible. |
This pull request has been automatically rebased to 5.1-dev. |
I ran in to that problem today, that I could not delete an access level. I tested the patch on J5.0.0 successfully, as I could see which table was concerned. In my case it was "#_fields", but it was not a com_content field, but a com_user field, that was still used with this access level. So, the error message with the table helped me a lot. Even if for a "normal" user the table info '#_fields' would not give sufficient information, because fields can be used in multiple areas. But an "experienced" user could have a look into the database and check. Also, a "normal" user would probably not have the rights to remove access levels. So, the PR might not completely solve the problem (or create errors with multiple deletes), but it reduces the amount of time enormously. I will test also for multiple and let you know. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39654. |
If I delete two or more access level at the same time, then only the usages of one access level in the error message. And shouldn't it be an error, not a warning? This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39654. |
Can you fix this for PBF? |
I have tested this item ✅ successfully on 56d67a5 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39654. |
Needs some work - and is nort ready at the moment |
I have tested this item ✅ successfully on 2eec18c This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39654. |
closing for a better solution. Pleas test #43223 |
Pull Request for Issue # .
Summary of Changes
An access level can only be delted if there is no content which uses this level. But there is no information given, which tabels are concerned.
This PR adds the list of tables to the error message.
Testing Instructions
Add an access level.
Set this access level for some items in your content, an article, a contact, a module .. whatever.
Then try to delete this access level.
Actual result BEFORE applying this Pull Request
You get a message
"You can't delete the view access level '%d:%s' because it is being used by content."
Expected result AFTER applying this Pull Request
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed