User tests: Successful: Unsuccessful:
Pull Request for Improvement .
All category views in the backend have a counting of items, except one, the user notes.
This PR adds it.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Easy | No | ⇒ | Yes |
Category | ⇒ | Components UI/UX |
I have tested this item unsuccessfully on d216abb
The trashed column is not working correctly
This should be showing TWO trashed items
This PR has received new commits.
CC: @brianteeman
sorry trashed was a copy paste problem. solved.
Anyway:
hum ... just notice that in this case the counting link goes to users and not to user notes.
So don't test until a way is found to solve this.
I can confirm the count is now working even if the link isnt yet ;)
This PR has received new commits.
CC: @brianteeman
the change is way bigger that i antecipated, it tuns out the user notes wasn't using the "notes" section of the categories.
I have made changes to make it use it "com_users.notes" extension instead of "com_users" extension in the categories.
This solves the link problem. but need further tests.
Anyway this SQL (https://github.com/andrepereiradasilva/joomla-cms/blob/com_user_notes-categories-counting/administrator/components/com_admin/sql/updates/mysql/3.5.2-2016-04-20.sql#L1) needs to be run before testing.
Also i guess i'll run to unit test problems too.
But i will check that later.
@andrepereiradasilva You know that the SQL will not be applied when using the update method "copy or unzip the files and then run the db fix"?
yes, but that's for all SQL updates right?
This PR has received new commits.
CC: @brianteeman
i will close this and reopen when ready.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-04-20 22:05:10 |
Closed_By | ⇒ | andrepereiradasilva |
@andrepereiradasilva Yes, all insert or update or delete statements in schema update scripts - the schema manager's db fix only applies create table or alter table.
hum, how do others do to solve that issue? do you know?
Yes: They can do nothing up to now. Is an open, unsolved issue.
I had the hope I could discuss that with @wilsonge because I have several ideas how to solve that, but seems he has no time.
When updating with Joomla! Update the update sql scripts are run if the version number in the file name is larger than the installed schema version (pre-update), and since Joomla! Update meanwhile contains the "Upload & Install" method, the number of people using the "copy or unzip the files and then run the db fix" method may have decreased, but as long as this is still a valid update method this is an issue.
The easiest way to solve this would be to make the db fixer run in the 1st attempt all statements from all scripts where version is larger than the schema version in db, as the updater does, but I am not sure if this would be a valid solution. There might be some reason why the schema manager doesn't already work like this, and I just don't know it.
@andrepereiradasilva For what you wanted to achieve with this PR here, would there not be another way to solve it, without changing the extension in the categories, so your SQL updates would not be required, e.g. by using a clever join or subquery for obtaining the right count (i.e. the user notes count and not the user count) for the particular category?
The count is ok without the SQL changes. The only problem is the URL in the counting, is linking to users instead of linking to user notes view.
I'm not an expert on this, but it seems the categories takes for the link the primary view of the component.
For instance, in com_content the primary view is the articles view. So the link in the categories count is index.php?option=com_content&[filters]
which is the same as index.php?option=com_content&view=articles&[filters]
.
In com_users the primary view is the users view. So the link in the categories count is index.php?option=com_users&[filters]
which is the same as index.php?option=com_users&view=users&[filters]
.
Because it assumes that there are categories for users.
Since, in this case, the categories are not for the primary view of the component users (the users view) i think we need the notes to be a category section inside com_users (com_users.notes
).
If i do all those changes if works perfectly. If there is another way. Don't know. But the way categories work, seems consistent to me that the user notes categories of the component users are a category section of com_users (com_users.notes
), and not the primary category of the the users component com_users
(that would be users categories, if existed).
Sure, you are right, should be as you say.
One way to solve that could be to add it to script.php to other hardcoded db changes, and run them in the schema updater as other stuff from script.php is run there, but I would not really like that.
The other way would be to leave it as it is so for the users having updated with the stone-age method the links would be wrong (for a while until we found a way to apply that).
Or maybe split it into 2 PRs, 1 for correct counting and the other one for this link thing, so we get at least the counting corrected soon.
i think i will split it in two PR:
com_users
to com_users.notes
Hmm why does the 2nd depend on the first? As far as I understood you before, the correction for the counts woutl work without the correction for the links. So I expected the order to be vice versa.
well for people understand why PR 1 is needed i prefer to do this way.
but of course, clearly this seems to go only for 3.6 so i have some time to look into that better.
hum ... just notice that in this case the counting link goes to users and not to user notes.
So don't test until a way is found to solve this.