Use the \Joomla\CMS\Table\Table::save inside your Model
This function is meant abstract all the functions for saving an item (bind, check, store).
In case it gets as 2nd parameter the ordering field name ($orderingFilter), it is supposed to re-order the item, based on the existing rows in the table.
Give a proper/incremental ordering number
Joomla 4.0 alpha6
Actual function that does the re-ordering
\Joomla\CMS\Table\Table::reorder
Labels |
Added:
?
|
Title |
|
Status | New | ⇒ | Information Required |
No clue about this one off the top of my head. Sounds bad tho. Added it onto my list
Labels |
Added:
?
|
Status | Information Required | ⇒ | Discussion |
Labels |
Removed:
?
|
Category | ⇒ | SQL |
Labels |
Added:
J4 Issue
|
can someone put the release blocker tag back please
Labels |
Added:
?
|
FWIW also the drag and drop functionality on any list view is based on this so also that won't work correctly
Maybe related with: joomla-framework/database#213
Is this a MySQL 8 issue? I can't reproduce this on 5.7.31.
One thing that doesn't make sense is that ordering condition is required for ordering to work at all. This should not be required.
Labels |
Added:
?
|
Hi @sakiss
@bembelimen and I tried to reproduce this issue and can't find a problem not by adding directly an entry to the table not by using the backend for com_content
$componet = JFactory::getApplication()->bootComponent('com_content');
/** @var JTable $table */
$table = $componet->getMVCFactory()->createTable('Article');
$array = [
'title' => 'Test1',
'alias' => 'test1',
'introtext' => 'text',
'catid' => 2,
'language' => '*',
'state' => 1,
];
$table->save($array, 'catid');
$array = [
'title' => 'Test2',
'alias' => 'test2',
'introtext' => 'text',
'catid' => 2,
'language' => '*',
'state' => 1,
];
$table->save($array, 'catid');
this code results in a proper ordering.
I'm removing the release blocker label and would close this issue until you can provide a code to reproduce this issue.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-11-24 20:29:34 |
Closed_By | ⇒ | HLeithner |
Labels |
Removed:
?
|
@infograf768 can you please comment?