Closed Xirdion closed 2 years ago
We got also the same error message and temporary fixed it by wrapping
case IsotopeAttributeWithOptions::SOURCE_PRODUCT:
in an if case:
if ($this instanceof IsotopeAttributeWithOptions) {
in /vendor/isotope/isotope-core/system/modules/isotope/library/Isotope/Model/Attribute.php
I am not 100% sure about possible side effects but the shop works right now for us. Just if someone else need a quick fix to get the shop up again.
Note: A downgrade to 2.6.15 didn't fix the problem for us - we tried that first.
Kannst du überprüfen, ob der TypeHint auf das Interface IsotopeAttributeWithOptions
notwendig ist, oder ob der TypeHint IsotopeAttribute
ausreicht und einen PR erstellen?
Der TypeHint ist leider notwendig, da die Funktion getOptionsSource()
aus dem Interface aufgerufen wird.
if (IsotopeAttributeWithOptions::SOURCE_TABLE !== $objAttribute->getOptionsSource()) {
throw new \LogicException('Options source for attribute "' . $objAttribute->field_name . '" is not the database table');
}
Entfernt man den TypeHint, dann bekommt man folgende Fehlermeldung.
Attempted to call an undefined method named "getOptionsSource" of class "Isotope\Model\Attribute\TextField".
Note: A downgrade to 2.6.15 didn't fix the problem for us - we tried that first.
Well, my quick fix was to downgrade. I deleted /vendor and the .lock file, reinstalled everything and it was fine then
I can confirm the issue. Downgrading using ~2.6.15
works for now.
How can I downgrade with contao manager, because I got:
In AttributeOption.php line 267: Argument 1 passed to Isotope\Model\AttributeOption::findByAttribute() must
if I want to dorngrade zu 2.6.15
Thanks a Lot!
How can I downgrade with contao manager
Just change the version requirement to either ~2.6.0
or 2.6.*
.
It Works ,thanks :)
Hi, I updated from 2.6 to 2.7.1 and still get the following error message when I want to update the database:
[2021-04-04 03:32:10] request.CRITICAL: Uncaught PHP Exception TypeError: "Argument 1 passed to Isotope\Model\AttributeOption::findByAttribute() must implement interface Isotope\Interfaces\IsotopeAttributeWithOptions, instance of Isotope\Model\Attribute\TextField given, called in /home/www/contao4_upd/vendor/isotope/isotope-core/system/modules/isotope/library/Isotope/Model/Attribute.php on line 260" at /home/www/contao4_upd/vendor/isotope/isotope-core/system/modules/isotope/library/Isotope/Model/AttributeOption.php line 267 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Isotope\\Model\\AttributeOption::findByAttribute() must implement interface Isotope\\Interfaces\\IsotopeAttributeWithOptions, instance of Isotope\\Model\\Attribute\\TextField given, called in /home/www/contao4_upd/vendor/isotope/isotope-core/system/modules/isotope/library/Isotope/Model/Attribute.php on line 260 at /home/www/contao4_upd/vendor/isotope/isotope-core/system/modules/isotope/library/Isotope/Model/AttributeOption.php:267)"} []
[2021-04-04 01:32:10] console.CRITICAL: Error thrown while running command "cache:warmup --env=prod". Message: "Argument 1 passed to Isotope\Model\AttributeOption::findByAttribute() must implement interface Isotope\Interfaces\IsotopeAttributeWithOptions, instance of Isotope\Model\Attribute\TextField given, called in /home/www/contao4_upd/vendor/isotope/isotope-core/system/modules/isotope/library/Isotope/Model/Attribute.php on line 260" {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Isotope\\Model\\AttributeOption::findByAttribute() must implement interface Isotope\\Interfaces\\IsotopeAttributeWithOptions, instance of Isotope\\Model\\Attribute\\TextField given, called in /home/www/contao4_upd/vendor/isotope/isotope-core/system/modules/isotope/library/Isotope/Model/Attribute.php on line 260 at /home/www/contao4_upd/vendor/isotope/isotope-core/system/modules/isotope/library/Isotope/Model/AttributeOption.php:267)","command":"cache:warmup --env=prod","message":"Argument 1 passed to Isotope\\Model\\AttributeOption::findByAttribute() must implement interface Isotope\\Interfaces\\IsotopeAttributeWithOptions, instance of Isotope\\Model\\Attribute\\TextField given, called in /home/www/contao4_upd/vendor/isotope/isotope-core/system/modules/isotope/library/Isotope/Model/Attribute.php on line 260"} []
I tried to downgrade to 2.6.15, deleted the vendor folder and then update to 2.7.1. Unfortunately, no luck with solving the error.
May be someone has an additional idea how to fix this. Thnx.
@aschempp is this really fixed by #2203?
Any news on this issue?
We also had this problem.
Our fix was pretty easy.
In the database 'tl_iso_attribute' we searched for the attributes of the type 'text'.
We saw that there were an attribute with the following value in the column 'optionsSource' = table.
We changed it to 'attribute' and everything was working as it should.
We have no idea where this did happen... :(
UPDATE
tl_iso_attributeSET optionsSource='attribute' WHERE optionsSource='table' AND type='text';
fixed in 852d492c9fe34426a293c5788680db1c7fc3a507
Using the new version of isotope (2.7) with Contao 4.9.11 leads to an error while building the cache.
Argument 1 passed to Isotope\Model\AttributeOption::findByAttribute() must implement interface Isotope\Interfaces\IsotopeAttributeWithOptions, instance of Isotope\Model\Attribute\TextField given
The problem is, that the function
findByAttribute
expects an argument with interfaceIsotopeAttributeWithOptions
. This interface is an extension ofIsotopeAttribute
. But the Attribute-class itself and e.g. the TextField-class just implementingIsotopeAttribute
. So the type is not correct because the child-interface is needed.example of an Attribute-instance
example of an child-interface of Isotope-Attribute
The interface that is needed when using the function
AttributeOption::findByAttribute()
.