? Success

User tests: Successful: Unsuccessful:

avatar andrepereiradasilva
andrepereiradasilva
20 Apr 2016

Pull Request for Improvement .

Summary of Changes

All category views in the backend have a counting of items, except one, the user notes.
This PR adds it.

Before PR

image

After PR

image

Testing Instructions

  1. Use latest staging and apply this patch
  2. Creste some user note categories and add some user notes to that categories
  3. Test if user notes counting is working properly.
d216abb 20 Apr 2016 avatar andrepereiradasilva qn
avatar andrepereiradasilva andrepereiradasilva - open - 20 Apr 2016
avatar andrepereiradasilva andrepereiradasilva - change - 20 Apr 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 Apr 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 20 Apr 2016
Easy No Yes
avatar brianteeman brianteeman - change - 20 Apr 2016
Category Components UI/UX
avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Apr 2016

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.

avatar brianteeman brianteeman - test_item - 20 Apr 2016 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 20 Apr 2016

I have tested this item :red_circle: unsuccessfully on d216abb

The trashed column is not working correctly


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10015.

avatar brianteeman
brianteeman - comment - 20 Apr 2016

This should be showing TWO trashed itemsscreen shot 2016-04-20 at 13 58 19


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10015.

avatar joomla-cms-bot
joomla-cms-bot - comment - 20 Apr 2016

This PR has received new commits.

CC: @brianteeman


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10015.

avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Apr 2016

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.

avatar brianteeman
brianteeman - comment - 20 Apr 2016

I can confirm the count is now working even if the link isnt yet ;)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10015.

avatar joomla-cms-bot
joomla-cms-bot - comment - 20 Apr 2016

This PR has received new commits.

CC: @brianteeman


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10015.

avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Apr 2016

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.

avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Apr 2016

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.

avatar richard67
richard67 - comment - 20 Apr 2016

@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"?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10015.

avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Apr 2016

yes, but that's for all SQL updates right?

avatar joomla-cms-bot
joomla-cms-bot - comment - 20 Apr 2016

This PR has received new commits.

CC: @brianteeman


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10015.

avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Apr 2016

i will close this and reopen when ready.

avatar andrepereiradasilva andrepereiradasilva - change - 20 Apr 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-04-20 22:05:10
Closed_By andrepereiradasilva
avatar andrepereiradasilva andrepereiradasilva - close - 20 Apr 2016
avatar andrepereiradasilva andrepereiradasilva - close - 20 Apr 2016
avatar richard67
richard67 - comment - 21 Apr 2016

@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.

avatar andrepereiradasilva
andrepereiradasilva - comment - 21 Apr 2016

hum, how do others do to solve that issue? do you know?

avatar richard67
richard67 - comment - 21 Apr 2016

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.

avatar richard67
richard67 - comment - 21 Apr 2016

@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?

avatar andrepereiradasilva
andrepereiradasilva - comment - 21 Apr 2016

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).

avatar richard67
richard67 - comment - 21 Apr 2016

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.

avatar andrepereiradasilva
andrepereiradasilva - comment - 21 Apr 2016

i think i will split it in two PR:

  • 1º PR: move users notes categories from extension com_users to com_users.notes
  • 2º PR: add counting to user notes categories (depends on the first)
avatar richard67
richard67 - comment - 21 Apr 2016

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.

avatar andrepereiradasilva
andrepereiradasilva - comment - 21 Apr 2016

well for people understand why PR 1 is needed i prefer to do this way.

avatar andrepereiradasilva
andrepereiradasilva - comment - 21 Apr 2016

but of course, clearly this seems to go only for 3.6 so i have some time to look into that better.

Add a Comment

Login with GitHub to post a comment