„Component with name ‚getControl‘ does not exist.“ po prechodu na PHP 7.3
- ali
- Člen | 342
Ahoj,
nahodil jsem si PHP 7.3 a zacala se mi objevovat zajimava chyba, viz popis nize. Po prechodu zpet na 7.2 vse funguje normalne. Napada nekoho kde muze byt zakopany pes? Formular je AJAXovy, pouzivam nette.ajax.js, vsechny ostatni Nette knihovny mam aktualni, krom PHP generatoru nette/php-generator: v3.0.5
Chyba:
Nette\InvalidArgumentException
Component with name 'getControl' does not exist.
Source:
if ($form->offsetExists('confirm')) {
echo end($this->global->formsStack)["confirm"]->getControl()->addAttributes(['class' => 'btn btn-outline-danger']) /* line 99 */;
}
Tovarna:
protected function createComponentRealQtyForm(): Nette\Application\UI\Form
{
$form = $this->form->create();
$form->elementPrototype->addClass('ajax');
if ($someCondition) {
$form->addSubmit('confirm', 'Confirm');
}
$form->onSuccess[] = function (Nette\Application\UI\Form $form, array $values): void {
if ($form->isSubmitted() instanceof Nette\Forms\Controls\SubmitButton && $form->isSubmitted()->getName() === 'confirm') {
...
}
};
return $form;
}
Sablona
{if $form->offsetExists(confirm)}{input confirm, class => 'btn btn-outline-danger'}{/if}
Editoval ali (7. 12. 2018 6:01)
- ali
- Člen | 342
nette/application v2.4.13 🏆 Nette Application: a full-stack component-based MVC kernel for PHP that helps you write powerful and modern web applications. Write less, have cleaner code and your work will bring you joy.
nette/bootstrap v2.4.6 🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.
nette/caching v2.5.8 ⏱ Nette Caching: library with easy-to-use API and many cache backends.
nette/component-model v2.4.0 ⚛ Nette Component Model
nette/di v2.4.14 💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.
nette/finder v2.4.2 🔍 Nette Finder: find files and directories with an intuitive API.
nette/forms v2.4.9 ?? Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server & client side validation and mature design.
nette/http v2.4.10 🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.
nette/mail v2.4.6 📧 Nette Mail: handy email creation and transfer library for PHP with both text and MIME-compliant support.
nette/neon v2.4.3 🍸 Nette NEON: encodes and decodes NEON file format.
nette/php-generator v3.0.5 🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.2 features.
nette/reflection v2.4.2 Nette Reflection: docblock annotations parser and common reflection classes
nette/robot-loader v3.1.0 🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.
nette/security v2.4.4 🔑 Nette Security: provides authentication, authorization and a role-based access control management via ACL (Access Control List)
nette/tester v2.1.0 Nette Tester: enjoyable unit testing in PHP with code coverage reporter. 🍏🍏🍎🍏
nette/utils v2.5.3 🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.
latte/latte v2.4.8 ☕ Latte: the intuitive and fast template engine for those who want the most secure PHP sites. Introduces context-sensitive escaping.
tracy/tracy v2.5.5 😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.
Editoval ali (7. 12. 2018 12:34)
- David Matějka
- Moderator | 6445
muzes poslat kompletni tracy?
ale tipoval bych to na chybu php, zkus vypnout opcache
- ali
- Člen | 342
@DavidMatějka po vypnuti opcache to funguje, tracy zde: https://uloz.to/…c8d97f3-html
@Milo cache soubory jsou totozne jak v PHP 7.2 tak 7.3 (cache byla smazana pred prepnutim jednotlivych verzi)
Editoval ali (10. 12. 2018 9:20)
- David Matějka
- Moderator | 6445
hm, tak to je zcela jiste problem s opcache – v tracy je videt, ze se do offsetGet predava „getControl“. nejlepsi by bylo, kdyby se ti povedlo to izolovat (tedy udelat nejmensi mozny nefunkcni kus kodu) a reportovat to na bugs.php.net