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

[Resolved] Mageplaza_Core has been already defined #3

Closed
imsamthomas opened this Issue May 5, 2017 · 32 comments

Comments

Projects
None yet
@imsamthomas
Contributor

imsamthomas commented May 5, 2017

Few customers reported to us the following issue:

Issue

Module 'Mageplaza_Core' from 'app/code/Mageplaza/Core' has been already defined in 'vendor/mageplaza/core-m2'.

Explain

There are 2 different ways to install Mageplaza extensions:

  1. Copy and paste: download from our store https://www.mageplaza.com
  2. Composer command

Because you installed Mageplaza Extensions via composer and now install by copying a package from our store.
In this case, it conflicts Core module. Now we are going to resolve this issue in 3 simple steps:

Solution

Step 1: You should DELETE Core module from

  • app/code/Mageplaza/Core
  • vendor/mageplaza/core-m2

Run the following command:

composer remove mageplaza/core-m2
rm -rf app/code/Mageplaza/Core
rm -rf vendor/mageplaza/core-m2
composer dump-autoload

Step 2: Now install Mageplaza_Core again run upgrade command line to resolve the issue.

composer require mageplaza/module-core
php bin/magento setup:upgrade

Step 3: Check result

Check the result, if there is still an issue, feel free to leave a comment here or contact us

@nsid32

This comment has been minimized.

Show comment
Hide comment
@nsid32

nsid32 May 6, 2017

I get
Autoload error: Module 'Mageplaza_Core' from '/vendor/mageplaza/module-core' has been already defined in '/vendor/mageplaza/core-m2'

by deleting 'vendor/mageplaza/module-core' doesn't work though...the upgrade command doesn't even run.

nsid32 commented May 6, 2017

I get
Autoload error: Module 'Mageplaza_Core' from '/vendor/mageplaza/module-core' has been already defined in '/vendor/mageplaza/core-m2'

by deleting 'vendor/mageplaza/module-core' doesn't work though...the upgrade command doesn't even run.

@alejandromartincruz

This comment has been minimized.

Show comment
Hide comment
@alejandromartincruz

alejandromartincruz Jun 7, 2017

Same result as nsid32: nothing works and upgrade not working neither

alejandromartincruz commented Jun 7, 2017

Same result as nsid32: nothing works and upgrade not working neither

@imsamthomas

This comment has been minimized.

Show comment
Hide comment
@imsamthomas

imsamthomas Jun 7, 2017

Contributor

Hi @alejandromartincruz ,

You should follow the solution mentioned above:

Solution

See #3 (comment)

Contributor

imsamthomas commented Jun 7, 2017

Hi @alejandromartincruz ,

You should follow the solution mentioned above:

Solution

See #3 (comment)

@alejandromartincruz

This comment has been minimized.

Show comment
Hide comment
@alejandromartincruz

alejandromartincruz Jun 7, 2017

I deleted app/code/Mageplaza/Core and when I type the command php bin/magento setup:upgrade
Then I got the error:
Autoload error: Module 'Mageplaza_Core' from '/var/www/html/magento2/vendor/mageplaza/module-core' has been already defined in '/var/www/html/magento2/vendor/mageplaza/core-m2'.ubuntu@ip-175-33-22-175:/var/www/html/magento2$

alejandromartincruz commented Jun 7, 2017

I deleted app/code/Mageplaza/Core and when I type the command php bin/magento setup:upgrade
Then I got the error:
Autoload error: Module 'Mageplaza_Core' from '/var/www/html/magento2/vendor/mageplaza/module-core' has been already defined in '/var/www/html/magento2/vendor/mageplaza/core-m2'.ubuntu@ip-175-33-22-175:/var/www/html/magento2$

@imsamthomas

This comment has been minimized.

Show comment
Hide comment
@imsamthomas

imsamthomas Jun 7, 2017

Contributor

You should delete both folders:

  • app/code/Mageplaza/Core
  • vendor/mageplaza/core-m2

Keep folder vendor/mageplaza/module-core

Contributor

imsamthomas commented Jun 7, 2017

You should delete both folders:

  • app/code/Mageplaza/Core
  • vendor/mageplaza/core-m2

Keep folder vendor/mageplaza/module-core

@alejandromartincruz

This comment has been minimized.

Show comment
Hide comment
@alejandromartincruz

alejandromartincruz Jun 7, 2017

Ok, so I delete vendor/mageplaza/core-m2

and then:

ubuntu@ip-175-33-22-175:/var/www/html/magento2$ php bin/magento setup:upgrade
Autoload error: Module 'Mageplaza_Core' from '/var/www/html/magento2/vendor/mageplaza/module-core' has been already defined in '/var/www/html/magento2/vendor/mageplaza/core-m2'.ubuntu@ip-175-33-22-175:/var/www/html/magento2$ php bin/magento setup:upgrade
PHP Warning:  require(/var/www/html/magento2/vendor/composer/../mageplaza/core-m2/registration.php): failed to open stream: No such file or directory in /var/www/html/magento2/vendor/composer/autoload_real.php on line 71
PHP Fatal error:  require(): Failed opening required '/var/www/html/magento2/vendor/composer/../mageplaza/core-m2/registration.php' (include_path='/var/www/html/magento2/vendor/phpunit/php-file-iterator:/var/www/html/magento2/vendor/phpunit/phpunit:/var/www/html/magento2/vendor/symfony/yaml:/var/www/html/magento2/vendor/magento/zendframework1/library:.:/usr/share/php') in /var/www/html/magento2/vendor/composer/autoload_real.php on line 71

vendor/mageplaza/module-core folder it's still in its place

Edit: finally it worked, but first I had to remove the line of the las module I added to composer.json

alejandromartincruz commented Jun 7, 2017

Ok, so I delete vendor/mageplaza/core-m2

and then:

ubuntu@ip-175-33-22-175:/var/www/html/magento2$ php bin/magento setup:upgrade
Autoload error: Module 'Mageplaza_Core' from '/var/www/html/magento2/vendor/mageplaza/module-core' has been already defined in '/var/www/html/magento2/vendor/mageplaza/core-m2'.ubuntu@ip-175-33-22-175:/var/www/html/magento2$ php bin/magento setup:upgrade
PHP Warning:  require(/var/www/html/magento2/vendor/composer/../mageplaza/core-m2/registration.php): failed to open stream: No such file or directory in /var/www/html/magento2/vendor/composer/autoload_real.php on line 71
PHP Fatal error:  require(): Failed opening required '/var/www/html/magento2/vendor/composer/../mageplaza/core-m2/registration.php' (include_path='/var/www/html/magento2/vendor/phpunit/php-file-iterator:/var/www/html/magento2/vendor/phpunit/phpunit:/var/www/html/magento2/vendor/symfony/yaml:/var/www/html/magento2/vendor/magento/zendframework1/library:.:/usr/share/php') in /var/www/html/magento2/vendor/composer/autoload_real.php on line 71

vendor/mageplaza/module-core folder it's still in its place

Edit: finally it worked, but first I had to remove the line of the las module I added to composer.json

@eddyonboard

This comment has been minimized.

Show comment
Hide comment
@eddyonboard

eddyonboard Jul 18, 2017

  1. Delete vendor/mageplaza/core-m2.
  2. run command composer dump-autoload
  3. run command php bin/magento setup:upgrade

eddyonboard commented Jul 18, 2017

  1. Delete vendor/mageplaza/core-m2.
  2. run command composer dump-autoload
  3. run command php bin/magento setup:upgrade
@bnchdrff

This comment has been minimized.

Show comment
Hide comment
@bnchdrff

bnchdrff Jul 24, 2017

if you're using any mageplaza language packs core-m2 might be required... so that makes these two modules conflict 😠

bnchdrff commented Jul 24, 2017

if you're using any mageplaza language packs core-m2 might be required... so that makes these two modules conflict 😠

@bnchdrff

This comment has been minimized.

Show comment
Hide comment
@bnchdrff

bnchdrff Jul 24, 2017

why are there two versions of the core module floating around?

bnchdrff commented Jul 24, 2017

why are there two versions of the core module floating around?

@blizam

This comment has been minimized.

Show comment
Hide comment
@blizam

blizam Aug 8, 2017

what's the permanent solution here? Everytime I do a new composer require core-m2 gets back in the mix

blizam commented Aug 8, 2017

what's the permanent solution here? Everytime I do a new composer require core-m2 gets back in the mix

@imsamthomas

This comment has been minimized.

Show comment
Hide comment
@imsamthomas

imsamthomas Aug 8, 2017

Contributor

@blizam

To Resolve core-m2

See #3 (comment)

Contributor

imsamthomas commented Aug 8, 2017

@blizam

To Resolve core-m2

See #3 (comment)

@alen12345

This comment has been minimized.

Show comment
Hide comment
@alen12345

alen12345 Aug 15, 2017

@eddyonboard

this is the real correct answer. Many thanks for sharing!

alen12345 commented Aug 15, 2017

@eddyonboard

this is the real correct answer. Many thanks for sharing!

@imsamthomas imsamthomas changed the title from Mageplaza_Core has been already defined to [Resolved] Mageplaza_Core has been already defined Aug 23, 2017

@plastikschnitzer

This comment has been minimized.

Show comment
Hide comment
@plastikschnitzer

plastikschnitzer Sep 9, 2017

Is there a final solution?

For the moment every time I do some setup:static-content:deploy or setup:upgrade I get the following message:

Autoload error: Module 'Mageplaza_Core' from '/mage2/vendor/mageplaza/core-m2' has been already defined in '/mage2/vendor/mageplaza/module-core'.

The only way to get around it is like @eddyonboard described, installing the new module-core is ending up in the same problem because this installs core-m2 version 1.3.1

plastikschnitzer commented Sep 9, 2017

Is there a final solution?

For the moment every time I do some setup:static-content:deploy or setup:upgrade I get the following message:

Autoload error: Module 'Mageplaza_Core' from '/mage2/vendor/mageplaza/core-m2' has been already defined in '/mage2/vendor/mageplaza/module-core'.

The only way to get around it is like @eddyonboard described, installing the new module-core is ending up in the same problem because this installs core-m2 version 1.3.1

@blizam

This comment has been minimized.

Show comment
Hide comment
@blizam

blizam Sep 10, 2017

It's a combination of @eddyonboard and @imsamthomas posts I as it's resolved for me currently.

Delete vendor/mageplaza/core-m2
composer remove mageplaza/core-m2
composer dump-autoload
composer require mageplaza/module-core
php bin/magento setup:upgrade

blizam commented Sep 10, 2017

It's a combination of @eddyonboard and @imsamthomas posts I as it's resolved for me currently.

Delete vendor/mageplaza/core-m2
composer remove mageplaza/core-m2
composer dump-autoload
composer require mageplaza/module-core
php bin/magento setup:upgrade

@alen12345

This comment has been minimized.

Show comment
Hide comment
@alen12345

alen12345 Sep 10, 2017

@blizam I can confirm your answer is perfectly valid 👍

alen12345 commented Sep 10, 2017

@blizam I can confirm your answer is perfectly valid 👍

@plastikschnitzer

This comment has been minimized.

Show comment
Hide comment
@plastikschnitzer

plastikschnitzer Sep 10, 2017

However I can not confirm. Every time I run composer and a dependency check is made, it will reinstall mageplaza/core-m2
So I searched trough all mageplaza extensions (all installed by composer!) and found out that the norwegian language pack requires mageplaza/core-m2 in its composer.json which is the reason why core-m2 is installed again and again no matter what I do.

So my solution was to run:

composer remove mageplaza/magento-2-norwegian-language-pack
composer clear-cache
composer remove mageplaza/core-m2
composer dump-autoload
php bin/magento setup:upgrade

I also created a pull request to correct the composer.json

plastikschnitzer commented Sep 10, 2017

However I can not confirm. Every time I run composer and a dependency check is made, it will reinstall mageplaza/core-m2
So I searched trough all mageplaza extensions (all installed by composer!) and found out that the norwegian language pack requires mageplaza/core-m2 in its composer.json which is the reason why core-m2 is installed again and again no matter what I do.

So my solution was to run:

composer remove mageplaza/magento-2-norwegian-language-pack
composer clear-cache
composer remove mageplaza/core-m2
composer dump-autoload
php bin/magento setup:upgrade

I also created a pull request to correct the composer.json

@imsamthomas

This comment has been minimized.

Show comment
Hide comment
@imsamthomas

imsamthomas Sep 11, 2017

Contributor

Thanks @blizam @alen12345 @plastikschnitzer
I have updated the solution on top of this topic: #3 (comment)

Contributor

imsamthomas commented Sep 11, 2017

Thanks @blizam @alen12345 @plastikschnitzer
I have updated the solution on top of this topic: #3 (comment)

@inelukipg

This comment has been minimized.

Show comment
Hide comment
@inelukipg

inelukipg Oct 13, 2017

Information for anyone using theme Porto.

If you use Porto theme you will get Mageplaza_Core has been already defined error.

app/code/Mageplaza/Core
app/code/Mageplaza/LayeredNavigation

are included in the Porto installation.
I did not use the layered navigation so I followed #3 (comment)

I did these steps.

rm -rf app/code/Mageplaza/Core
php bin/magento setup:upgrade

I dont know if it's ok to leave the app/code/Mageplaza/LayeredNavigation but it's disabled so it should not be any problem.

inelukipg commented Oct 13, 2017

Information for anyone using theme Porto.

If you use Porto theme you will get Mageplaza_Core has been already defined error.

app/code/Mageplaza/Core
app/code/Mageplaza/LayeredNavigation

are included in the Porto installation.
I did not use the layered navigation so I followed #3 (comment)

I did these steps.

rm -rf app/code/Mageplaza/Core
php bin/magento setup:upgrade

I dont know if it's ok to leave the app/code/Mageplaza/LayeredNavigation but it's disabled so it should not be any problem.

@gixid192

This comment has been minimized.

Show comment
Hide comment
@gixid192

gixid192 Oct 13, 2017

Collaborator

@inelukipg It's all right, as long as you disable it (via module:disable), it won't run in any case.

Collaborator

gixid192 commented Oct 13, 2017

@inelukipg It's all right, as long as you disable it (via module:disable), it won't run in any case.

@inelukipg

This comment has been minimized.

Show comment
Hide comment
@inelukipg

inelukipg Oct 13, 2017

@gixid192 Ok! Do you know why there is different core modules from Mageplaza with different names?
module-core, Core, core-m2?

inelukipg commented Oct 13, 2017

@gixid192 Ok! Do you know why there is different core modules from Mageplaza with different names?
module-core, Core, core-m2?

@gixid192

This comment has been minimized.

Show comment
Hide comment
@gixid192

gixid192 Oct 13, 2017

Collaborator

@inelukipg Sorry if that made you confused.

As our business grows, we changed the name time to time. The reason is Magento offers 2 different ways of installing extensions so some installed by Composer, others prefer copy/paste method.
We are trying to fix this issue by instructing users to install core-module by composer, as you can see from our user guide here: https://www.mageplaza.com/install-magento-2-extension/

Collaborator

gixid192 commented Oct 13, 2017

@inelukipg Sorry if that made you confused.

As our business grows, we changed the name time to time. The reason is Magento offers 2 different ways of installing extensions so some installed by Composer, others prefer copy/paste method.
We are trying to fix this issue by instructing users to install core-module by composer, as you can see from our user guide here: https://www.mageplaza.com/install-magento-2-extension/

@inelukipg

This comment has been minimized.

Show comment
Hide comment
@inelukipg

inelukipg Oct 16, 2017

@gixid192 Ok, but vendor/mageplaza/module-core is the latest version?
I mean if I decide to buy another extension from Mageplaza and install via composer it will work with that core module?

inelukipg commented Oct 16, 2017

@gixid192 Ok, but vendor/mageplaza/module-core is the latest version?
I mean if I decide to buy another extension from Mageplaza and install via composer it will work with that core module?

@gixid192

This comment has been minimized.

Show comment
Hide comment
@gixid192

gixid192 Oct 16, 2017

Collaborator

@inelukipg oh yes, that's the latest name if you are using Composer.
You can just follow our user guide (the link I gave above), everything will be all right.

Collaborator

gixid192 commented Oct 16, 2017

@inelukipg oh yes, that's the latest name if you are using Composer.
You can just follow our user guide (the link I gave above), everything will be all right.

@LucScu

This comment has been minimized.

Show comment
Hide comment
@LucScu

LucScu Oct 27, 2017

follow @inelukipg's answer #3 (comment) if have yourstore theme and try to install a lang package

LucScu commented Oct 27, 2017

follow @inelukipg's answer #3 (comment) if have yourstore theme and try to install a lang package

@gx2g

This comment has been minimized.

Show comment
Hide comment
@gx2g

gx2g Nov 15, 2017

I can't not remove your core plugin I'm getting this error and Mageplaza_Affiliate is disabled as well as Mageplaza_Core. after doing this I also tried to remove the extention by doing composer remove mageplaza/module-core and I'm getting this error now

PHP Fatal error: Class 'Mageplaza\Core\Helper\AbstractData' not found in /chroot/home/newcloud/cloudvdesign.com/html/app/code/Mageplaza/Affiliate/Helper/Data.php on line 20

Fatal error: Class 'Mageplaza\Core\Helper\AbstractData' not found in /chroot/home/newcloud/cloudvdesign.com/html/app/code/Mageplaza/Affiliate/Helper/Data.php on line 20

We want to remove this plugin completely because it simply doesnt work

gx2g commented Nov 15, 2017

I can't not remove your core plugin I'm getting this error and Mageplaza_Affiliate is disabled as well as Mageplaza_Core. after doing this I also tried to remove the extention by doing composer remove mageplaza/module-core and I'm getting this error now

PHP Fatal error: Class 'Mageplaza\Core\Helper\AbstractData' not found in /chroot/home/newcloud/cloudvdesign.com/html/app/code/Mageplaza/Affiliate/Helper/Data.php on line 20

Fatal error: Class 'Mageplaza\Core\Helper\AbstractData' not found in /chroot/home/newcloud/cloudvdesign.com/html/app/code/Mageplaza/Affiliate/Helper/Data.php on line 20

We want to remove this plugin completely because it simply doesnt work

@imsamthomas

This comment has been minimized.

Show comment
Hide comment
@imsamthomas

imsamthomas Nov 16, 2017

Contributor

Your store cannot run without Mageplaza_Core module.

You removed the old Core module, then you should install the new one via composer:

Step 2 : Now run upgrade command line to resolve the issue.

composer require mageplaza/module-core
php bin/magento setup:upgrade
Contributor

imsamthomas commented Nov 16, 2017

Your store cannot run without Mageplaza_Core module.

You removed the old Core module, then you should install the new one via composer:

Step 2 : Now run upgrade command line to resolve the issue.

composer require mageplaza/module-core
php bin/magento setup:upgrade
@dinkeronline

This comment has been minimized.

Show comment
Hide comment
@dinkeronline

dinkeronline Dec 19, 2017

@imsamthomas your solution on top works well for one time, but you need to update the Norwegian language pack to avoid the problems, every composer command re installs core-m2.

Please merge the pull request asap - mageplaza/magento-2-norwegian-nynorsk-language-pack#3

dinkeronline commented Dec 19, 2017

@imsamthomas your solution on top works well for one time, but you need to update the Norwegian language pack to avoid the problems, every composer command re installs core-m2.

Please merge the pull request asap - mageplaza/magento-2-norwegian-nynorsk-language-pack#3

@imsamthomas

This comment has been minimized.

Show comment
Hide comment
@imsamthomas

imsamthomas Dec 28, 2017

Contributor

@dinkeronline thanks for notifying us here.
We have pulled the pacakge.

Contributor

imsamthomas commented Dec 28, 2017

@dinkeronline thanks for notifying us here.
We have pulled the pacakge.

@pramodhanu

This comment has been minimized.

Show comment
Hide comment
@pramodhanu

pramodhanu Feb 9, 2018

@imsamthomas Can you help me for install sociallogin_v2.4.0.1_ce_mageplaza extension in magento 2 store.in sociallogin_v2.4.0.1_ce_mageplaza extension ZIP file i have 2 folder -app, lib.i have read your all reply for install this extension(sociallogin_v2.4.0.1_ce_mageplaza).but i need help
Can you tell me Step by step process for install this extension.

and Mageplaza_Core module i have zip file.when i have extract this file i have found
Block, Controller, etc, Helper, i18n, Model, Observer, view folder. how to install this module. i mean here is not app folder etc.

pramodhanu commented Feb 9, 2018

@imsamthomas Can you help me for install sociallogin_v2.4.0.1_ce_mageplaza extension in magento 2 store.in sociallogin_v2.4.0.1_ce_mageplaza extension ZIP file i have 2 folder -app, lib.i have read your all reply for install this extension(sociallogin_v2.4.0.1_ce_mageplaza).but i need help
Can you tell me Step by step process for install this extension.

and Mageplaza_Core module i have zip file.when i have extract this file i have found
Block, Controller, etc, Helper, i18n, Model, Observer, view folder. how to install this module. i mean here is not app folder etc.

@SoCix

This comment has been minimized.

Show comment
Hide comment
@SoCix

SoCix Feb 16, 2018

just follow this

Delete the following files, folders::
app/code/Mageplaza/EXTENSION_NAME

Run the following command line::
php bin/magento setup:upgrade

SoCix commented Feb 16, 2018

just follow this

Delete the following files, folders::
app/code/Mageplaza/EXTENSION_NAME

Run the following command line::
php bin/magento setup:upgrade

@cadam

This comment has been minimized.

Show comment
Hide comment
@cadam

cadam May 9, 2018

solution indicated by @imsamthomas worked. Thx!
Does this means that magento comes already with that module preinstalled? cuz I did not uploaded any module directly, but only through composer..

cadam commented May 9, 2018

solution indicated by @imsamthomas worked. Thx!
Does this means that magento comes already with that module preinstalled? cuz I did not uploaded any module directly, but only through composer..

@wakar

This comment has been minimized.

Show comment
Hide comment
@wakar

wakar Aug 6, 2018

thanks @inelukipg, it works.

wakar commented Aug 6, 2018

thanks @inelukipg, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment