Bug #68503

check if array key exists before use them

Added by Martin Tepper over 5 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2015-07-24
Due date:
% Done:

100%

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

Description

Hello,

in my case i call TYPO3\CMS\Core\Database\ReferenceIndex::updateRefIndexTable() and this runs fetchTableRelationFields().
This method uses the TCA. But when the given table hasn't a TCA configuration a PHP warning will thrown.

#1

Updated by Mathias Schreiber over 5 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Mathias Schreiber

Why would you call that method for a table that has no rendering definition?

#2

Updated by Martin Tepper over 5 years ago

I use the extension update_refindex which has a scheduler task where you can choose tables.
There was a wrong configuration in my case and i got the warning. In generell i think that should not happen.

#3

Updated by Mathias Schreiber over 5 years ago

How do you spot the false configuration then?
Personally, I'd rather throw an exception making clear that the configuration is corrupt making usage of the extension impossible until the error has been resolved.

#4

Updated by Martin Tepper over 5 years ago

Sure, because of the warning :)

I agree.

Issue can be closed.

#5

Updated by Mathias Schreiber over 5 years ago

  • Assignee changed from Mathias Schreiber to Stephan Großberndt

nono, no need to close it.
The core needs to throw the exception.

I'll assign this to Dr. RefIndex (currently on holiday)

#6

Updated by Gerrit Code Review over 5 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42599

#7

Updated by Gerrit Code Review over 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42599

#8

Updated by Gerrit Code Review over 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42599

#9

Updated by Gerrit Code Review over 5 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42640

#10

Updated by Stephan Großberndt over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#11

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF