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



Ready to elevate your e-commerce business?

Discuss your business objectives with us. Get in touch today to explore ways we can assist in reaching them.

Copyright © 2021-2024 ArmMage LLC. All rights reserved.