Skip to content

Commit

Permalink
[TASK] Resolve v12 TCA deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
bnf committed Oct 17, 2024
1 parent 321664c commit 3f4035d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 38 deletions.
26 changes: 11 additions & 15 deletions Configuration/TCA/Overrides/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

// Add folder configuration
$GLOBALS['TCA']['pages']['columns']['module']['config']['items'][] = [
0 => $ll . 'blog-folder',
1 => 'blog',
2 => 'record-folder-contains-blog',
'label' => $ll . 'blog-folder',
'value' => 'blog',
'icon' => 'record-folder-contains-blog',
];
$GLOBALS['TCA']['pages']['ctrl']['typeicon_classes']['contains-blog'] = 'record-folder-contains-blog';

Expand All @@ -26,9 +26,9 @@
'pages',
'doktype',
[
'LLL:EXT:blog/Resources/Private/Language/locallang_tca.xlf:pages.doktype.blog-post',
(string) \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_POST,
'record-blog-post',
'label' => 'LLL:EXT:blog/Resources/Private/Language/locallang_tca.xlf:pages.doktype.blog-post',
'value' => (string) \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_POST,
'icon' => 'record-blog-post',
],
'1',
'after'
Expand All @@ -37,9 +37,9 @@
'pages',
'doktype',
[
'LLL:EXT:blog/Resources/Private/Language/locallang_tca.xlf:pages.doktype.blog-page',
(string) \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE,
'record-blog-page',
'label' => 'LLL:EXT:blog/Resources/Private/Language/locallang_tca.xlf:pages.doktype.blog-page',
'value' => (string) \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE,
'icon' => 'record-blog-page',
],
(string) \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_POST,
'after'
Expand Down Expand Up @@ -135,10 +135,8 @@
'archive_date' => [
'label' => $ll . 'pages.archive_date',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'type' => 'datetime',
'size' => '13',
'eval' => 'datetime',
'default' => '0',
'behaviour' => [
'allowLanguageSynchronization' => true
Expand All @@ -148,10 +146,8 @@
'publish_date' => [
'label' => $ll . 'pages.publish_date',
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'type' => 'datetime',
'size' => '13',
'eval' => 'datetime',
'default' => '0',
'behaviour' => [
'allowLanguageSynchronization' => true
Expand Down
12 changes: 6 additions & 6 deletions Configuration/TCA/Overrides/sys_category.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
'renderType' => 'selectSingle',
'items' => [
[
'LLL:EXT:blog/Resources/Private/Language/locallang_tca.xlf:sys_category.record_type.default',
(string) \T3G\AgencyPack\Blog\Constants::CATEGORY_TYPE_DEFAULT,
$GLOBALS['TCA']['sys_category']['ctrl']['typeicon_classes']['default']
'label' => 'LLL:EXT:blog/Resources/Private/Language/locallang_tca.xlf:sys_category.record_type.default',
'value' => (string) \T3G\AgencyPack\Blog\Constants::CATEGORY_TYPE_DEFAULT,
'icon' => $GLOBALS['TCA']['sys_category']['ctrl']['typeicon_classes']['default']
],
[
'LLL:EXT:blog/Resources/Private/Language/locallang_tca.xlf:sys_category.record_type.blog',
(string) \T3G\AgencyPack\Blog\Constants::CATEGORY_TYPE_BLOG,
'record-blog-category'
'label' => 'LLL:EXT:blog/Resources/Private/Language/locallang_tca.xlf:sys_category.record_type.blog',
'value' => (string) \T3G\AgencyPack\Blog\Constants::CATEGORY_TYPE_BLOG,
'icon' => 'record-blog-category'
]
],
'default' => (string) \T3G\AgencyPack\Blog\Constants::CATEGORY_TYPE_DEFAULT
Expand Down
13 changes: 6 additions & 7 deletions Configuration/TCA/tx_blog_domain_model_author.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
'label_alt_force' => 0,
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'default_sortby' => 'ORDER BY title',
'delete' => 'deleted',
'enablecolumns' => [
Expand Down Expand Up @@ -76,7 +75,7 @@
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'required',
'required' => true,
],
'l10n_display' => 'defaultAsReadonly',
'l10n_mode' => 'exclude',
Expand Down Expand Up @@ -105,9 +104,9 @@
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['Please choose one avatar provider', '--div--'],
['Gravatar', \T3G\AgencyPack\Blog\AvatarProvider\GravatarProvider::class],
['Image', \T3G\AgencyPack\Blog\AvatarProvider\ImageProvider::class],
['label' => 'Please choose one avatar provider', 'value' => '--div--'],
['label' => 'Gravatar', 'value' => \T3G\AgencyPack\Blog\AvatarProvider\GravatarProvider::class],
['label' => 'Image', 'value' => \T3G\AgencyPack\Blog\AvatarProvider\ImageProvider::class],
],
],
'l10n_mode' => 'exclude',
Expand Down Expand Up @@ -156,9 +155,9 @@
'email' => [
'label' => $ll . 'tx_blog_domain_model_author.email',
'config' => [
'type' => 'input',
'type' => 'email',
'size' => 30,
'eval' => 'required,email',
'required' => true,
],
'l10n_mode' => 'exclude',
],
Expand Down
12 changes: 5 additions & 7 deletions Configuration/TCA/tx_blog_domain_model_comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
'label_alt_force' => 1,
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'default_sortby' => 'ORDER BY crdate DESC',
'delete' => 'deleted',
'enablecolumns' => [
Expand Down Expand Up @@ -80,9 +79,8 @@
'email' => [
'label' => $ll . 'tx_blog_domain_model_comment.email',
'config' => [
'type' => 'input',
'type' => 'email',
'size' => 30,
'eval' => 'email',
],
],
'comment' => [
Expand All @@ -105,10 +103,10 @@
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
[$ll . 'tx_blog_domain_model_comment.status.pending', \T3G\AgencyPack\Blog\Domain\Model\Comment::STATUS_PENDING],
[$ll . 'tx_blog_domain_model_comment.status.approved', \T3G\AgencyPack\Blog\Domain\Model\Comment::STATUS_APPROVED],
[$ll . 'tx_blog_domain_model_comment.status.declined', \T3G\AgencyPack\Blog\Domain\Model\Comment::STATUS_DECLINED],
[$ll . 'tx_blog_domain_model_comment.status.deleted', \T3G\AgencyPack\Blog\Domain\Model\Comment::STATUS_DELETED],
['label' => $ll . 'tx_blog_domain_model_comment.status.pending', 'value' => \T3G\AgencyPack\Blog\Domain\Model\Comment::STATUS_PENDING],
['label' => $ll . 'tx_blog_domain_model_comment.status.approved', 'value' => \T3G\AgencyPack\Blog\Domain\Model\Comment::STATUS_APPROVED],
['label' => $ll . 'tx_blog_domain_model_comment.status.declined', 'value' => \T3G\AgencyPack\Blog\Domain\Model\Comment::STATUS_DECLINED],
['label' => $ll . 'tx_blog_domain_model_comment.status.deleted', 'value' => \T3G\AgencyPack\Blog\Domain\Model\Comment::STATUS_DELETED],
],
],
],
Expand Down
6 changes: 3 additions & 3 deletions Configuration/TCA/tx_blog_domain_model_tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
'transOrigDiffSourceField' => 'l18n_diffsource',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'default_sortby' => 'ORDER BY title',
'delete' => 'deleted',
'enablecolumns' => [
Expand Down Expand Up @@ -67,7 +66,8 @@
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'required,trim',
'required' => true,
'eval' => 'trim',
],
],
'slug' => [
Expand Down Expand Up @@ -134,7 +134,7 @@
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['', 0],
['label' => '', 'value' => 0],
],
'foreign_table' => 'tx_blog_domain_model_tag',
'foreign_table_where' => 'AND tx_blog_domain_model_tag.pid=###CURRENT_PID### AND tx_blog_domain_model_tag.sys_language_uid IN (-1,0)',
Expand Down

0 comments on commit 3f4035d

Please sign in to comment.