Cannot process definition to array for type tinytext in Magento 2.x

This error occurs because any third-party extension’s table’s column data type as tinytext.

This error occurs if any Third Party Extension’s table’s column data type as tinytext

Solution:: There are following below steps need to follow

Step [1] – Open below path file

/vendor/magento/framework/Setup/Declaration/Schema/Db/DefinitionAggregator.php

 fint fromDefinition() method and then add debug code to find column name as below , we have addedd (debugging) code inside

/* Starts Add Code for Debug */ and /* Code End for Debug */

To find column name

public function fromDefinition(array $data)
    {
        $type = $data['type'];
        if (!isset($this->definitionProcessors[$type])) {

            /* Starts Add Code for Debug */

            echo "<pre>";
            print_r($data); exit();

            /* Code End for Debug  */

            throw new \InvalidArgumentException(
                sprintf("Cannot process definition to array for type %s", $type)
            );
        }

        $definitionProcessor = $this->definitionProcessors[$type];
        return $definitionProcessor->fromDefinition($data);
    }

Step [2] – Run setup:upgrade command and you will get an array of column data in the console. so from this array, you will get the name of the column from your third party extension table.

Now from that table please change column’s data type “tinytext” to “text” 

Step [3] – Finally issue has been resolved.

Leave a Reply

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