Project

General

Profile

Actions

Bug #29893

closed

Moving more than 1 inline record messes up the DB

Added by Xavier Perseguers about 13 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-09-16
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

I have a few staff records, in them I have 1-n departments

I edit one of them and add a new department, before saving I reorganize it to be positioned not at the end of the list of previous departements but in between => OK, WORKING!

When I edit existing staff and reorganize existing departments, NO PROBLEM

When I edit one of my staff, I create at least 2 (!) new departments and reorganize them BEFORE saving, then I get a big mess, actually not totally ! If my staff has in the end M departments, then the M first departments (seems so, ordered by uid) have the staff column (foreign_field) used as sortby column and got a sorting value that seems to start at 2^(count of departments in my table), but only the M first departments are affected

Actions #1

Updated by Xavier Perseguers about 13 years ago

TCA for staff:

'departments' => array(
    'exclude' => 0,
    'label' => 'Departments',
    'config' => array(
        'type' => 'inline',
        'foreign_table' => 'tx_staffdirectory_departments',
        'foreign_field' => 'staff',
        'foreign_sortby' => 'sorting',
        'maxitems' => 99,
        'appearance' => array(
            'collapse' => 0,
            'useSortable' => 1,
            'newRecordLinkPosition' => 'bottom',
        ),
    )
),

TCA for department:

'staff' => array(
    'config' => array(
        'type' => 'passthrough',
    )
),

Can reproduce with 4.5.6 and master

Actions #2

Updated by Xavier Perseguers about 13 years ago

  • Status changed from New to Accepted

OK. After investigation I found the setting that causes this bug.

I had this in my ext_tables.php file:

$TCA['tx_staffdirectory_departments'] = array(
    'ctrl' => array(
        // ...
        'default_sortby' => 'ORDER BY staff, position_title',
        'sortby' => 'staff',

The 'sortby' clauses (here 'staff') is different from the inline definition ('foreign_sortby' => 'sorting'.

I could not determine where exactly this is used (I first thought of line 649, method writeForeignField of t3lib_loaddbgroup) but it's seems this is somewhere else.

Removing this sortby clause in ext_tables.php solves the bug.

Actions #3

Updated by Alexander Opitz almost 10 years ago

  • Status changed from Accepted to Needs Feedback
  • Is Regression set to No

Hi,

as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.2.7)?

Actions #4

Updated by Xavier Perseguers over 9 years ago

  • Status changed from Needs Feedback to Closed

I guess no, never had any feedback on it and not involved in the corresponding project. Must have been fixed by an intermediate release.

Thanks for asking.

Actions

Also available in: Atom PDF