Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ready for Contao 5 #19

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Ready for Contao 5 #19

wants to merge 8 commits into from

Conversation

ericges
Copy link

@ericges ericges commented Mar 19, 2024

No description provided.

@ericges ericges requested a review from koertho March 19, 2024 09:54
@ericges ericges self-assigned this Mar 19, 2024
Copy link
Contributor

@koertho koertho left a comment

Choose a reason for hiding this comment

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

Habe mal ein wenig durchgeschaut. Wenn wir schon ne neue Major machen, sollten wir nicht stumpf einfach nur kompatibel machen, dann brauchen wir keine Major. Sehe ehrlich gesagt nicht wirklich breaking changes.
Falls wir doch ne neue Major machen wollen, sollten wir auch ein paar Dinge anpacken:

  1. Deprecations entfernen, bitte mal den Code danach durchsuchen.
  2. Den DC_Multilingual-Kram vielleicht in eine EventListener-Klasse kapseln und damit aus dem restlichen Code rausnehmen.
  3. Siehe andere Kommentare :)

List-Bundle ist leider ne größere Baustelle..mal wieder :D

Copy link
Contributor

Choose a reason for hiding this comment

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

Die Klasse ist ja deprecated, könnte also einfach raus ;)

System::getContainer()->get('huh.utils.image')->addToTemplateData($imageField, $imageSelectorField,
$templateData[$templateContainer][$templateVariable], $imageArray, null, null,
null, $imageFile);
Polyfill::addImageToTemplateData(
Copy link
Contributor

Choose a reason for hiding this comment

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

Ähm...bitte doch gleich auf aktuell Contao-Services umstellen


System::getContainer()->get('huh.filter.session')->setData($sessionKey, $sessionData);
$jumpTo = $configElement->tagsJumpTo;
if ($jumpTo && $jumpTo != $GLOBALS['objPage']?->id || $jumpTo = null)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nicht mit $GLOBALS['objPage'] arbeiten, wenn dann mit Utils->request->getCurrentPage()

*
* @return Model|null
*/
$filterConfigElement = function () use ($configElement, &$filterConfigElement) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Das ist leider wirklich unnötig. Einfach im if FilterConfigElementModel::findByPk() nutzen, gleicher effekt, weniger unnötiger code ;)

$videoData['size'] = sprintf(' width="%s" height="%s" ', $size->width, $size->height);
}

$itemData = $item->getRaw();
$itemData['size'] = $listConfigElement->videoSize;

if ($listConfigElement->posterImageField && $item->getRawValue($listConfigElement->posterImageField)) {
$this->imageUtil->addToTemplateData($listConfigElement->posterImageField, '', $videoData['posterImg'], $itemData);
Polyfill::addImageToTemplateData($listConfigElement->posterImageField, '', $videoData['posterImg'], $itemData);
Copy link
Contributor

Choose a reason for hiding this comment

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

Auch hier bitte wieder Contao Bordmittel verwenden.

Copy link
Contributor

Choose a reason for hiding this comment

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

Könnte man in dem Zuge zu "HeimrichHannotListBundle" umbenennen


public function __construct(Utils $utils)
{
if (!($_ENV['UPGRADE_LIST_ALLOW_DC_MULTILINGUAL'] ?? false)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ehrlich gesagt sollten wir das List-Interface raus kicken oder durch was sinnvolles bzw. ne abstrakte Klasse ersetzen. So ist das Interface völliger Irrsinn.

@@ -736,7 +737,7 @@

$dca['fields']['numberOfItems']['eval']['tl_class'] = 'w50 clr';

if (System::getContainer()->get('huh.utils.container')->isBundleActive('modal')) {
if (in_array('modal', array_keys(System::getContainer()->getParameter('kernel.bundles')))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Das kann raus, das alte Modal-Modul müssen wir nicht mehr utnerstützen.

@@ -759,7 +760,9 @@
$dca['subpalettes']['addDetails'] = 'useModalExplanation,useModal,'.$dca['subpalettes']['addDetails'];
}

if (System::getContainer()->get('huh.utils.container')->isBundleActive('Terminal42\DcMultilingualBundle\Terminal42DcMultilingualBundle')) {
if (in_array('Terminal42\DcMultilingualBundle\Terminal42DcMultilingualBundle',
Copy link
Contributor

Choose a reason for hiding this comment

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

Können wir nicht das ganze DC_Multilingual-Zeug in einen Event-Listener packen, damit es nicht so verteilt ist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants