Bug #33316

Syntax-Error: Two If-clauses with assign-operator instead of equal-operator in class.db_list.inc; Solution included!

Added by Clemens Riccabona over 1 year ago. Updated over 1 year ago.

Status:Rejected Start date:2012-01-19
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:Code Cleanup
Target version:- Estimated time:0.10 hour
TYPO3 Version:4.5 Complexity:no-brainer
PHP Version:
Votes: 1 (View)

Description

I don't know if the code is in any use, but due to some debugging I stumbled over a syntax-error in class.db_list.inc in at least TYPO3 4.5.9 and 4.5.10 at line 194 ff

// code snippet original begin
// this will hide records from display - it has nothing todo with user rights!!
if ($pidList = $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages')) {
if ($pidList = $GLOBALS['TYPO3_DB']->cleanIntList($pidList)) {
$this->perms_clause .= ' AND pages.uid NOT IN ('.$pidList.')';
}
}
// code snippet original end

This should be changed to this I think:


// code snippet corrected begin
// this will hide records from display - it has nothing todo with user rights!!
if ($pidList $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages')) {
if ($pidList $GLOBALS['TYPO3_DB']->cleanIntList($pidList)) {
$this->perms_clause .= ' AND pages.uid NOT IN ('.$pidList.')';
}
}
// code snippet corrected end

History

Updated by Clemens Riccabona over 1 year ago

aehm, seems that my '==' has been cleared out by the software.
so my code posted is NOT correct, but i could not find the possibility to correct it. ...

Updated by Markus Klein over 1 year ago

  • Target version deleted (4.5.11)

Not a bug!

Look at the code

    // this will hide records from display - it has nothing todo with user rights!!
if ($pidList = $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages')) {
    if ($pidList = $GLOBALS['TYPO3_DB']->cleanIntList($pidList)) {
        $this->perms_clause .= ' AND pages.uid NOT IN ('.$pidList.')';
    }
}

This assignment is done by intention as it is used in the following line each time.

Updated by Clemens Riccabona over 1 year ago

ah, ok, cryptic. ;)
so it is not a bug, but ugly coding style (IMHO) ... ;)
and ide will most likely always complain about this (netbeans does). ...

sry, my fault. i should read 'more exactly' ... ;)

could be closed so.

Updated by Stefan Galinski over 1 year ago

  • Status changed from New to Rejected

Also available in: Atom PDF