Skip to content

Comments

[RTM] Skip folder DCs that are not database assisted in DcaExtractor#744

Merged
leofeyer merged 2 commits intocontao:hotfix/4.3.8from
madeyourday:fix/dc-folder-deprecation
Apr 19, 2017
Merged

[RTM] Skip folder DCs that are not database assisted in DcaExtractor#744
leofeyer merged 2 commits intocontao:hotfix/4.3.8from
madeyourday:fix/dc-folder-deprecation

Conversation

@ausi
Copy link
Member

@ausi ausi commented Mar 29, 2017

The install tool currently shows the deprecation message “Using database.sql files has been deprecated and will no longer work in Contao 5.0. Use a DCA file instead.” because it thinks tl_templates uses a database.sql file.

With this PR DC_Folders that are not database assisted get skipped in the DcaExtractor.

}

// Return if the DC type is "Folder" and is not database assisted
if ($GLOBALS['TL_DCA'][$this->strTable]['config']['dataContainer'] == 'Folder' && empty($GLOBALS['TL_DCA'][$this->strTable]['config']['databaseAssisted']))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the empty() check here (although it might be technically correct).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I replace it with (!isset($GLOBALS['TL_DCA'][$this->strTable]['config']['databaseAssisted']) || !$GLOBALS['TL_DCA'][$this->strTable]['config']['databaseAssisted'])?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably just $GLOBALS['TL_DCA'][$this->strTable]['config']['databaseAssisted']? You have now added isset() to databaseAssisted but not to dataContainer

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought dataContainer is a required field because there is no isset check 6 lines above. Wouldn’t removing the isset check result in “undefined index” notices?

@leofeyer leofeyer added the bug label Apr 5, 2017
@leofeyer leofeyer added this to the 4.3.8 milestone Apr 5, 2017
@leofeyer leofeyer changed the base branch from master to hotfix/4.3.8 April 19, 2017 09:00
@leofeyer leofeyer merged commit 96c5ed9 into contao:hotfix/4.3.8 Apr 19, 2017
@leofeyer leofeyer modified the milestones: 4.3.8, 4.3 May 14, 2019
leofeyer added a commit that referenced this pull request Sep 12, 2019
* Order the page models by the order of candidates (see #740)

* Use FIND_IN_SET() directly

* Add a unit test

* Use ORDER BY FIELD() instead of FIND_IN_SET()

* Simplify the findPages() method

* Do not load the models separately

* Run the CS fixer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants