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

[Resolved] Mageplaza_Core has been already defined #3

Closed
imsamthomas opened this issue May 5, 2017 · 44 comments
Closed

[Resolved] Mageplaza_Core has been already defined #3

imsamthomas opened this issue May 5, 2017 · 44 comments
Labels

Comments

@imsamthomas
Copy link
Contributor

@imsamthomas 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 (if any)

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
Copy link

@nsid32 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
Copy link

@alejandromartincruz alejandromartincruz commented Jun 7, 2017

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

@imsamthomas
Copy link
Contributor Author

@imsamthomas imsamthomas commented Jun 7, 2017

Hi @alejandromartincruz ,

You should follow the solution mentioned above:

Solution

See #3 (comment)

@alejandromartincruz
Copy link

@alejandromartincruz 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
Copy link
Contributor Author

@imsamthomas 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
Copy link

@alejandromartincruz 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
Copy link

@eddyonboard 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
Copy link

@bnchdrff 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
Copy link

@bnchdrff bnchdrff commented Jul 24, 2017

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

@blizam
Copy link

@blizam 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
Copy link
Contributor Author

@imsamthomas imsamthomas commented Aug 8, 2017

@blizam

To Resolve core-m2

See #3 (comment)

@alen12345
Copy link

@alen12345 alen12345 commented Aug 15, 2017

@eddyonboard

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

@imsamthomas imsamthomas changed the title Mageplaza_Core has been already defined [Resolved] Mageplaza_Core has been already defined Aug 23, 2017
@plastikschnitzer
Copy link

@plastikschnitzer 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
Copy link

@blizam 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
Copy link

@alen12345 alen12345 commented Sep 10, 2017

@blizam I can confirm your answer is perfectly valid 👍

@plastikschnitzer
Copy link

@plastikschnitzer 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
Copy link
Contributor Author

@imsamthomas imsamthomas commented Sep 11, 2017

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

@inelukipg
Copy link

@inelukipg 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
Copy link
Collaborator

@gixid192 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
Copy link

@inelukipg 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
Copy link
Collaborator

@gixid192 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
Copy link

@inelukipg 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
Copy link
Collaborator

@gixid192 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
Copy link

@LucScu LucScu commented Oct 27, 2017

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

@gx2g
Copy link

@gx2g 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
Copy link
Contributor Author

@imsamthomas 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
Copy link

@dinkeronline 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
Copy link
Contributor Author

@imsamthomas imsamthomas commented Dec 28, 2017

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

@pramodhanu
Copy link

@pramodhanu 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
Copy link

@SoCix 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
Copy link

@cadam 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
Copy link

@wakar wakar commented Aug 6, 2018

thanks @inelukipg, it works.

@thrmda
Copy link

@thrmda thrmda commented Nov 10, 2018

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

not core_m2

@gixid192
Copy link
Collaborator

@gixid192 gixid192 commented Nov 10, 2018

@thrmda The core_m2 is the old name, you can follow the insturction by replacing it with the new name module-core

@sunnetmedia

This comment was marked as disruptive content.

@shweta2014
Copy link

@shweta2014 shweta2014 commented May 3, 2019

It worked for me .. thanks buddy

@krenninger
Copy link

@krenninger krenninger commented May 8, 2019

Solution worked for me and saved my butt. Thank you so much!!

@live4soccer7
Copy link

@live4soccer7 live4soccer7 commented Jun 7, 2020

When I implement this resolution (using porto) I get a lot of errors when running: php bin/magento setup:static-content:deploy -f

For this reason, I have had to make sure to not use any other mageplaza extensions, unfortunately :( It was tested on 2.3.3. We are on 2.3.5-p1 now and I will test one more time, but I expect the result to be the same.

Edit: I have tried on 2.3.5-p1 and it is now working properly.

@githuzz
Copy link

@githuzz githuzz commented Aug 12, 2020

Thank you for the solution provided by @imsamthomas it worked perfectly, im using magento CE 2.3.5-p1 with Porto theme, production site. You saved my day!

@rashigoyal14
Copy link

@rashigoyal14 rashigoyal14 commented Aug 26, 2020

I got an error that Class Mageplaza\CustomerApproval\Console\Command\Approve\Interceptor does not exist. Please specify the solution

@evagabond
Copy link

@evagabond evagabond commented Sep 4, 2020

If using Porto & Mageplaza Search module, try this:

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

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

@rashigoyal14
Copy link

@rashigoyal14 rashigoyal14 commented Sep 4, 2020

For Mageplaza it is mandatory to have the Mageplaza_Core module.
After that, all errors will be resolved.

Thanks

@evagabond
Copy link

@evagabond evagabond commented Sep 4, 2020

For Mageplaza it is mandatory to have the Mageplaza_Core module.
After that, all errors will be resolved.

Thanks

I had it, but in spite of having the Mageplaza_Core module, errors can still occur, because of various reasons such as using theme such as Porto where the Mageplaza_Search module comes bundled etc.

@NguyenvanLuc06081994
Copy link

@NguyenvanLuc06081994 NguyenvanLuc06081994 commented Nov 24, 2020

im in magento 2.4. your module supports only magento 2.3.x ????
please help me. Thank you

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

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.