extension_builder
extension_builder copied to clipboard
🐛 [BUG] Renaming of model name is not possible.
Describe the bug Renaming of model name is not possible. An error message is shown, and I added a line for debug output to see what's happening, see it on the screenshot below.
To Reproduce Steps to reproduce the behavior:
- Create a model with the name "Entries", save the extension.
- Rename the model to "Entry", try to save again.
- See the error
Expected behavior It's expected that the changed model name is saved.
Screenshots
TYPO3 Version 11.5.4
Extension Builder Version: TER version 11.0.1
I could circumvent it by changing the method like this:
protected function replaceUpperAndLowerCase(string $search, string $replace, $haystack): string
{
if (!is_array($haystack)) {
$result = str_replace(ucfirst($search), ucfirst($replace), $haystack);
return str_replace(lcfirst($search), lcfirst($replace), $result);
} else {
return '';
}
}
Even with the provided code change, I get another error when renaming a model:
$injectMethod->getBodyStmts() returns an object, not an array or string.