You are implementing a before plugin in MyCompany_Magic. It will intercept the same method that MyCompany_Admission is already intercepting using a before plugin: Topmenu::getBlockHtml Which two actions are required to ensure the new plugin will execute last?

You are implementing a before plugin in MyCompany_Magic. It will intercept the same method that MyCompany_Admission is already intercepting using a before plugin: Topmenu::getBlockHtml Which two actions are required to ensure the new plugin will execute last? (Choose two.)
A. Include a sortOrder="20" on the new plugin in MyCompany_Magic’s etc/di.xml file
B. Configure plugin sequencing for both plugins in MyCompany_Magic’s etc/plugin_sequence.xml file
C. Set a sortOrder="10" for MyCompany_Admission’s plugin in MyCompany_Magic’s etc/di.xml
D. Add MyCompany_Admission as a dependency in MyCompany_Magic’s etc/module.xml file

Download Printable PDF. VALID exam to help you PASS.

14 thoughts on “You are implementing a before plugin in MyCompany_Magic. It will intercept the same method that MyCompany_Admission is already intercepting using a before plugin: Topmenu::getBlockHtml Which two actions are required to ensure the new plugin will execute last?

  1. My Opinion is A and D because when i tested plugin without sort order load always before the plugin which have sort order where you define sequence dependency in module.xml or not.

    so when i try combination A and C worked and A and D also worked but combination C and D failed to do that.
    so we can see according to simplicity A and D is correct and no necessory to define already defined plugin sort order except those plugin are from Magento\Framwork or any library module.

    1
    1
    1. Completely Agree with you, I also practically checked and got similar results. A&D or A&C both could be the Answer but A and D would be the more appropriate answer than A&C as module MyCompany_Admission was already installed so we can set dependency into MyCompany_Magic module.xml file.

  2. Magento documentations says:
    “If two or more plugins have the same sortOrder value or do not specify it, the component load order declared in the sequence node from module.xml and area will define the merge sequence. Check the component load order in app/etc/config.php file.”

    In our case we can set 2 different sortOrder values so correct values are A ans C

    2
    1
  3. I believe the answer is A & D,

    E – plugin_sequence.xml is not a thing.
    C – Since the vendor of this module are both MyCompany, we can safely assume that the same developer created both modules therefore there should be little point in specifying sortOrder=”10″ within MyCompany_Magic’s etc/di.xml. Besides, if you’re going to do this, you should really depend on MyCompany_Admission in MyCompany_Magic’s etc/module.xml file anyway.

  4. A and D is correct ans

    For A and C scenario :
    A. Include a sortOrder=”20″ on the new plugin in MyCompany_Magic’s etc/di.xml file
    >> MyCompany_Magic’s etc/di.xml file

    C. Set a sortOrder=”10″ for MyCompany_Admission’s plugin in MyCompany_Magic’s etc/di.xml
    >> MyCompany_Magic’s etc/di.xml file

    why both plugin’s sort orders need to define in one module ?
    it should be in module’s di.xml file

  5. Correct answer is A,C. B no such file plugin_sequence.xml. D has nothing to do with order of plugin execution

    3
    1

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.