contao-community-alliance / contao-multicolumnwizard-bundle

Contao 4 Widget - MultiColumnWizard
GNU Lesser General Public License v3.0
12 stars 12 forks source link

BC break #39

Closed aschempp closed 5 years ago

aschempp commented 5 years ago

Due to the renaming of namespaces, this bundle contains BC breaks with the previous version! I think it should be release as version 4 instead of 3.x

see https://github.com/isotope/core/issues/2020

stefanheimes commented 5 years ago

@discordier Do you see any problem if i change the widget class? See code below:

// Current Version
$GLOBALS['BE_FFL']['multiColumnWizarde'] = '\MenAtWork\MultiColumnWizardBundle\Contao\Widgets\MultiColumnWizard';

// new Version
$GLOBALS['BE_FFL']['multiColumnWizard']  = '\MultiColumnWizard';

aschempp is right, if i use the new class, i have a BC break, so i have to use the old one. Did we get any problems with MM or DCG with this change?

@aschempp my intention was to make a drop-in-replacement. I don't want any BC break in this version. So, this is a bug and must be fixed before i release the stable.

aschempp commented 5 years ago

I think you can also try class_alias, but not sure how you would load that (except maybe using the Contao class loader?). I wasn't aware this isn't stable yet, no idea how people came to install it then…

discordier commented 5 years ago

IMO it could be fixed by suffixing the \MenAtWork\MultiColumnWizardBundle\Contao\Widgets\MultiColumnWizard with a class_alias as @aschempp said.

Like Contao does in 4.6, so the file MultiColumnWizard.php should become:

<?php

namespace MenAtWork\MultiColumnWizardBundle\Contao\Widgets;

class MultiColumnWizard
{
// ...
}

class_alias(MultiColumnWizard::class, 'MultiColumnWizard');

Have not tested as I lack an isotope installation but should work.

aschempp commented 5 years ago

It might work for the method argument, but someone requiring \MultiColumnWizard would still result in a class not found. Not really related to Isotope but anyone using that extension…

discordier commented 5 years ago

@stefanheimes maybe you should add a class loader for the deprecated class in root namespace as we do in MM

Ainschy commented 5 years ago

That work for me as hotfix

<?php

namespace MenAtWork\MultiColumnWizardBundle\Contao\Widgets;

class MultiColumnWizard
{
// ...
}

class_alias(MultiColumnWizard::class, 'MultiColumnWizard');
stefanheimes commented 5 years ago

Should be fixed in version 3.4.0. (no beta)

stefanheimes commented 5 years ago

@Ainschy can you test it with the new version 3.4.1 again?

Ainschy commented 5 years ago

Same issue with 3.4.1 in product-typs under isotope, when i set

class_alias(MultiColumnWizard::class, 'MultiColumnWizard');

its worked, but whitout

Type error: Argument 1 passed to Isotope\Backend\ProductType\AttributeWizard::getColumns() must be an instance of MultiColumnWizard, instance of MenAtWork\MultiColumnWizardBundle\Contao\Widgets\MultiColumnWizard given, called in E:\MAMP_2018\htdocs_eb\vendor\menatwork\contao-multicolumnwizard-bundle\src\Contao\Widgets\MultiColumnWizard.php on line 644

discordier commented 5 years ago

3.4.2 should finally fix this for good - closing therefore.