Project

General

Profile

Actions

Bug #86167

closed

Having a field in TCA but not in database makes the DatabaseIntegrityCheck crash

Added by Stefan P over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2018-09-06
Due date:
% Done:

100%

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

Description

Ticket #79992 is somehow related.

sysext/core/Classes/Integrity/DatabaseIntegrityCheck.php line 443 throws a Null Pointer exception if a field is declared in TCA but not actually present in the database. I see two possible solutions here:
  1. only iterate over the intersection between TCA fields and actual database fields
  2. echo a note that there's a field declared that is not present and continue the loop with the next field

I prefer solution two, because it'd provide a nice check if there's some inconsistent/obsolete TCA configuration which should be fixed.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #86092: Do not fetch type=none fields from db in list moduleClosed2018-09-03

Actions
Related to TYPO3 Core - Bug #79992: Error in DB Check -> Database RelationsClosedNicole Cordes2017-02-24

Actions
Actions #1

Updated by Georg Ringer over 5 years ago

  • Related to Bug #86092: Do not fetch type=none fields from db in list module added
Actions #2

Updated by Georg Ringer over 5 years ago

  • Status changed from New to Needs Feedback

Maybe it has been solved for you with #86092.

However how do you define the field in TCA? please add some code and explain (if not using type none) why there should be no related field in the DB. Thanks

Actions #3

Updated by Stefan P over 5 years ago

I had the field fe_group in the columns section of some TCA files, but did not have the field in ext_tables.sql (because the table didn't use frontend authentification features). I know that this is actually a wrong configuration (good old copy-paste error) - but it seems only to fail in the DatabaseIntegrityCheck, that's how I noticed this behaviour.

#86092 has nothing to do with it (the list module works fine).

IMHO the DatabaseIntegrityCheck should actually check if a field is present in the database schema before accessing it and throw some kind of notice instead of just failing with a null pointer exception.

Actions #4

Updated by Christian Kuhn over 5 years ago

  • Assignee set to Christian Kuhn

i'm fiddling in a similar area at the moment and can have a look at this case.

Actions #5

Updated by Christian Kuhn over 5 years ago

  • Related to Bug #79992: Error in DB Check -> Database Relations added
Actions #6

Updated by Christian Kuhn over 5 years ago

I'll push a patch to prevent the crash.

A check to verify TCA and ext_tables.sql are in sync should not belong to this module, though. imho, the entire db check / lowlevel thing needs rethinking, we may eventually do that with v10 (v9 is feature frozen already). Thus for now, I think it is enough to prevent the crash and further work on this topic in a future core version.

Actions #7

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 https://review.typo3.org/58201

Actions #8

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 https://review.typo3.org/58201

Actions #9

Updated by Christian Kuhn over 5 years ago

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

Updated by Gerrit Code Review over 5 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58221

Actions #11

Updated by Anja Leichsenring over 5 years ago

  • Status changed from Under Review to Resolved
Actions #12

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF