enter image description here I have to override the Customer module.


in my custom module


here is registration.php file :


in etc folder di.xml and module.xml file


<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Customer\Model\Indexer\Source" type="Magenticians\Moduleproduct\Model\Indexer\Source" />


<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magenticians_Moduleproduct" setup_version="1.0.1">

just add one function in source.php file

public function addAttributeToSelect($fieldName, $alias = null)
   $this->customerCollection->addAttributeToSelect($fieldName, $alias);
   return $this;}

override successfully. customer re-indexing has done.

but got an issue in Wysywig editor shows a broken image. which I insert in pages.

when I remove this overridden module Wysywig editor shows images properly. I want to identify what's wrong with my module and why Wyswig show a broken image when this module is here?


Please check all php files of your custom extension and please check this 2 poinst.

  1. Make sure that all php files start with <?php tag, with no space before it (most probably registration.php)
  2. Check if all you php files does not have ?> at the end of file, if yes, remove php close tag.



have empty line before <?php tag. Please fix it and it will work as expected.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.