Commit 791cb96f authored by Oliver Hader's avatar Oliver Hader Committed by Oliver Hader
Browse files

[BUGFIX] Fatal Error due to class object inconsistencies in ext:form

Elements in the form wizard can either be defined by TypoScript or
by using the accordant wizard. Some of these elements don't have a
counterparts in the ExtJS form wizard and thus only work in the
TypoScript mode. In these cases, the missing JSON conversion
objects lead to fatal errors.

Resolves: #69399
Releases: master, 6.2
Change-Id: Ide39afcbdc483dc01d9cdc9165c89c34785f847d
Reviewed-on: http://review.typo3.org/42913

Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarSebastian Wagner <sebastian.wagner@tritum.de>
Tested-by: Björn Jacob's avatarBjoern Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
parent b298745b
......@@ -62,6 +62,7 @@ class ObjectFactory {
/**
* @param string $classNameOrAlias
* @return object
* @throws \RuntimeException
*/
static public function createFormObject($classNameOrAlias) {
$lowerCasedClassNameOrAlias = strtolower($classNameOrAlias);
......@@ -70,6 +71,11 @@ class ObjectFactory {
} else {
$className = $classNameOrAlias;
}
if (!class_exists($className)) {
throw new \RuntimeException('Class "' . $className . '" does not exist', 1440779351);
}
$arguments = func_get_args();
$arguments[0] = $className;
return call_user_func_array(array(GeneralUtility::class, 'makeInstance'), $arguments);
......
......@@ -116,8 +116,15 @@ class TypoScriptToJsonConverter {
* @return void
*/
public function addElement(AbstractJsonElement $parentElement, $class, array $arguments) {
$element = $this->createElement($class, $arguments);
$parentElement->addElement($element);
try {
$element = $this->createElement($class, $arguments);
$parentElement->addElement($element);
} catch (\RuntimeException $exception) {
// Catch missing classes or element types
// There are elements that can be used the
// TypoScript-like declaration, which don't
// have a counterpart in the ExtJS wizard.
}
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment