2

I'm throwing this error on my /success/ page and it seems like such a generic error. It looks like further down the trace it's pointing to stuff like GoogleTagManager and other third-party modules associated with checkout but I've disabled nearly everything and it still fires this exception on checkout.

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'argument': The type definition is abstract. Line: 1024 Internal error: xmlSchemaXPathProcessHistory, The state object to be removed is not the first in the list. Line: 1022 Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'argument': The type definition is abstract. Line: 1024 Internal error: xmlSchemaXPathProcessHistory, The state object to be removed is not the first in the list. Line: 1022 #0 /chroot/home/m2.staging/html/vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...') #1 /chroot/home/m2.staging/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Framework\Config\Dom->__construct('<layout xmlns:x...', Object(Magento\Framework\App\Arguments\ValidationState), Array, NULL, '/chroot/home/zt...', '%message%\nLine:...') #2 /chroot/home/m2.staging/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array) #3 /chroot/home/m2.staging/html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array) #4 /chroot/home/m2.staging/html/vendor/magento/framework/Config/DomFactory.php(42): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array) 

Now if I edit this file here like so:

protected function _initDom($xml) line 382 of vendor/magento/framework/Config/Dom.php

+// Note: Ignore validations. Yes the errors/warnings should be fixed but I don't know where to fix them and just want to get things done, can fix up "Later... TM". +$skipDomValidation = true; +if ($skipDomValidation === false) { if ($this->validationState->isValidationRequired() && $this->schema) { $errors = $this->validateDomDocument($dom, $this->schema, $this->errorFormat); if (count($errors)) { throw new \Magento\Framework\Config\Dom\ValidationException(implode("\n", $errors)); } } +} 

Which is not good practices but it subdues the original error message and now throws this error message.

1 exception(s): Exception #0 (InvalidArgumentException): Value for key "xsi:type" is missing in the argument data. /chroot/home/m2.staging/html/vendor/magento/framework/View/Layout/Reader/Block.php(370): Magento\Framework\Data\Argument\Interpreter\Composite->evaluate(Array) #1 /chroot/home/m2.staging/html/vendor/magento/framework/View/Layout/Reader/Block.php(169): Magento\Framework\View\Layout\Reader\Block->evaluateArguments(Object(Magento\Framework\View\Layout\Element), Array) 

Such a generic error message. Any help would be greatly appreciated. Thank you.

magento 2.2.5

1 Answer 1

1

I just came across a similar error so here is an answer to this seemingly old question:

<type name="Vendor\Module\Model\Layer\FilterResolver"> <arguments> <argument name="filterAttributes"> <!-- to the left here is the error --> <item xsi:type="array"> <item xsi:type="object" name="brandfilter">brandsFilter</item> <item xsi:type="object" name="modelfilter">modelFilter</item> </item> </argument> </arguments> </type> 

Just add a xsi:type to the argument tag. In the above case, this will look like this:

<type name="Vendor\Module\Model\Layer\FilterResolver"> <arguments> <argument name="filterAttributes" xsi:type="array"> <item xsi:type="array"> <item xsi:type="object" name="brandfilter">brandsFilter</item> <item xsi:type="object" name="modelfilter">modelFilter</item> </item> </argument> </arguments> </type> 

For your very special case: I think it already gives you the line where something went wrong: 1024 - unfortunately this doesn't include the filename. Look into a di.xml that you've changed recently.

This is a general issue with this type of error output. If you still got issues to find the argument, use the following xpath expression:

//argument[not(@xsi:type)] 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.