Add more flexibility to JTable ordering#12464
Conversation
| { | ||
| // If there is no ordering field set an error and return false. | ||
| if (!property_exists($this, 'ordering')) | ||
| $orderingField = $this->getColumnAlias('ordering'); |
There was a problem hiding this comment.
Surely this is not doing what the doc block above it says?
There was a problem hiding this comment.
How would you change the doc block?
|
I updated the code comments where it is throwing an exception instead of setting an error and returning false. |
|
Is there something else I should change? |
|
bump |
|
needs two successfull tests to get merged in the core. |
|
…le times; fix missing quoteField
|
Both should be fixed now @csthomas |
|
I have tested this item ✅ successfully on fd08d7b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12464. |
|
What about other files: I'm not sure but IMHO nested.php should be changed too. |
|
Never used those classes. I bet you are right. I will run through the rest of the libraries and see if there are others. |
|
Only JTable and JTableNested need to have this abstraction layer. The other subclasses are "final" implementations for each table. |
|
I added the abstraction layer to JTableNested. I feel like it should be on JTableAsset as well @mbabker since it is using a variable for the table name. |
|
A lot of the JTable subclasses reference the class variables in the methods versus hardcoding things like the table key(s) or name. JTableAsset is the class directly mapping to the |
|
Gotcha. I end up extending core classes a lot, so its always nice when the abstraction is already there. However, abstracting everything is likely out of the scope of this PR. |
libraries/joomla/table/nested.php
Outdated
| // If the table has an ordering field, use that for ordering. | ||
| if (property_exists($this, 'ordering')) | ||
| $orderingField = $this->getColumnAlias('ordering'); | ||
| if (!property_exists($this, $orderingField)) |
There was a problem hiding this comment.
You have to remove exclamation mark.
|
That was just terrible. What I get for rushing. |
|
I tested successful Code style: |
|
No idea. I don't see anything in here though however: http://joomla.github.io/coding-standards/?coding-standards/chapters/php.md |
|
I have tested this item ✅ successfully on 32a6436 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12464. |
|
How does the HumanTestResults test work? |
|
I have tested this item ✅ successfully on 32a6436 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12464. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12464. |
@davidjosephhayes you can take a look here: https://docs.joomla.org/Testing_Joomla!_patches#Recording_test_results It is a feature of ours custom issue tracker arround GitHub :) |
|
With the last 4 commit i have fixed some CS Issue travis did not mention (why?) and updated this branch to the last staging. |
|
@davidjosephhayes could you please look at the conflicts? |
|
Is it just me or is the conflict page not loading? |
|
For me it is not working too. |
|
@davidjosephhayes this is the conflicting file: |
|
How do I do know what to fix? When I click the Resolive Conflicts, nothing loads. |
|
I should have fixed conflicts here. Can I have one tester to confirm this PR still works please |
|
I have tested this item ✅ successfully on fc626b1 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12464. |
Pull Request for Issue # .
Summary of Changes
Set JTable and JModelAdmin to use the JTable::_columnAlias property for ordering. Defaults to original behavior when there is no ordering property of JTable::_columnAlias.
Basically this implements what the function documentation for JTable::getColumnAlias says:
* Method to return the real name of a "special" column such as ordering, hits, published
* etc etc. In this way you are free to follow your db naming convention and use the
* built in Joomla functions.
Testing Instructions
Use any built in component and reorder items.
Documentation Changes Required
None.