nazgul26 / PHPRecipebook

Cookbook and Meal planning software. Runs on PHP with MySQL/PostgreSQL.
62 stars 39 forks source link

Order in "RecipeLinksTitle" #66

Closed Luegengladiator closed 6 years ago

Luegengladiator commented 6 years ago

base_types order is by id (create order). I would like to see the the menu orderd alphabetic by name but didn't find a way to change the SQL

nazgul26 commented 6 years ago

Where are you seeing the base types not ordered? In Recipe edit it is:

$baseTypes = $this->Recipe->BaseType->find('list', array('order' => array('name')));
Luegengladiator commented 6 years ago

Thanks for the reply. Sorry the Question was not clear enough. In "recipeLinkBox" all items are ordered by SQL-ID. I like to see it ordered alphabetic. At least the base_types. Example: I have eggs, potatoes, vegetables ordered correct because its added this way. Adding Fish now I get eggs, potatoes, vegetables, fish. Instead I want to see it eggs, fish, potatoes, vegetables

Changing Controller/RecipesController.php I'll get: Error: syntax error, unexpected '**' (T_POW) File: /var/www/html/phprecipebook/Controller/RecipesController.php Line: 173 But I think this is not .... OK See the edit now :D Please forget this Error. But that is not the solution.

nazgul26 commented 6 years ago

Found the problem. It was pretty bad, it was pulling the entire object from the DB to get a simple list. I have fixed it up and now it orders as well.

https://github.com/nazgul26/PHPRecipebook/commit/de8fbf6b71a47440f4bcc759fe8337a3e1013750

Will be in next release or pull now.

Luegengladiator commented 6 years ago

Fix confirmed. Thanks a lot!