Bug #75163
closedExtbase Repository Default Orderings and the lastUpdated Column
0%
Description
In my project i have mapped the pages table to a local domain object in order to show for example related pages using a extbase plugin.
I would like to sort the results by the lastUpdated column, however this seems to be impossible with the extbase repository as it automatically converts the camelcase notation to an underscore form:
lastUpdated => last_updated
Which then results in an error...
This is the setting in the repository:
@class PageRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
@ protected $defaultOrderings = array("lastUpdated"=> \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING );
and this the resulting exception:
#1247602160: Unknown column 'pages.last_updated' in 'order clause' (More information)
Updated by Mathias Brodala over 8 years ago
- Status changed from New to Needs Feedback
Have you tried specifying a mapping to prevent this automatic conversion? Thus something like:
plugin.tx_myext { persistence { classes { Vendor\MyExt\Domain\Model\Page { mapping { tableName = pages columns { lastUpdated.mapOnProperty = lastUpdated } } } } } }
In general you should first try to ask e.g. in https://typo3.slack.com/messages/typo3-cms/ for support. This tracker is only meant for reporting issues.
Updated by Wouter Wolters over 8 years ago
- Status changed from Needs Feedback to Closed
The example Mathias provides should solve the issue you have. I'm closing this ticket now because this is not a core bug.