Development

#8970 (sort option in generator.yml doesn't work)

You must first sign up to be able to contribute.

Ticket #8970 (new defect)

Opened 3 years ago

sort option in generator.yml doesn't work

Reported by: *Lo* Assigned to: fabien
Priority: minor Milestone:
Component: generator Version: 1.4.6
Keywords: Cc:
Qualification: Unreviewed

Description

Hi, The sort option in the generator.yml file is never used in the getSort() function of the autoM_xxxxx class because $this->getUser()->getAttribute('xxxxx.sort', null, 'admin_module') return an array (xxxxx.sort: [null, null]) instead of simple null. So it always returns $sort, even with value [null, null].

The function :

protected function getSort()

{

if (null !== $sort = $this->getUser()->getAttribute('xxxxx.sort', null, 'admin_module')) {

return $sort;

}

$this->setSort($this->configuration->getDefaultSort()); return $this->getUser()->getAttribute('xxxxx.sort', null, 'admin_module');

}

Should be (or something like this):

protected function getSort()

{

$sort = $this->getUser()->getAttribute('xxxxx.sort', null, 'admin_module');

if ($sort && isset($sort[0]) && $sort[0]) {

return $sort;

}

$this->setSort($this->configuration->getDefaultSort()); return $this->getUser()->getAttribute('xxxxx.sort', null, 'admin_module');

}