Cannot process definition to array for type [date ,tinytext ] on Magento 2

Cannot process definition to array for type  [date ,tinytext ] on Magento 2

The problem is happening from Magento upgrade v2.3 to v2.4.3-p1.

  1. Open file:

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

2. Replace function fromDefinition:

			
public function fromDefinition(array $data)
{
	
	$type = $data['type'];
	
	if(in_array($type, ["tinytext", "enum"])){
		$data['type'] = 'text';
		$type = 'text';
	}
	
	if(in_array($type, ['time', 'mediumint'])){
		$data['type'] = 'datetime';
		$type = 'datetime';
	}
	
	if(in_array($type, ['mediumint'])){
		$data['type'] = 'int';
		$type = 'int';
	}
	
	if (!isset($this->definitionProcessors[$type])) {
		throw new \InvalidArgumentException(
			sprintf("Cannot process definition to array for type %s", $type)
		);
	}

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

I hope it will help you if you have any questions or need development assistance
Contact us



If this solution isn't working for you, seek answers from ChatGPT


Please note that to ensure accurate and relevant responses, your questions should be related to Magento 2.

Ready to elevate your e-commerce business?

Let's talk about your business goals. Contact us now to see how we can help achieve them.

 
Copyright © 2021-present ArmMage Inc. All rights reserved.