I have a custom EAV attribute called thumbnail_link_text which is a category attribute. When I try to display it either on the frontend or backend using the default accessor like this,

echo $category->getThumbnailLinkText();

it is always returning a value of 1. I'm sure it is not a boolean because the data type of this attribute is text.

Also, in Magento 2's admin panel, I added a custom category field where you can enter an input value for this attribute.

I tried entering a new value on a certain category but it is also sets the value to 1 after saving.

enter image description here

I checked the database on the table catalog_category_entity_text, and the correct value is stored successfully. Meaning, the custom attribute is working when saving but not working when displaying. But, this is working before in production.

Another thing that's confusing is that the custom attribute is working perfectly in my development server but not in production server anymore. The dev server is a perfect clone of the production server. Only that the version of the dev is in 2.2.8 and the production is 2.2.5.

Am I missing something to check and test? Is it a directory or a file permission issue? A 3rd party or another custom module? Or an interceptor? If the category is being overridden somewhere, why is it that only this attribute is being affected?

  • try this $category->getData('thumbnail_link_text'); – Rk Rathod May 28 '19 at 7:20
  • @RkRathod Thanks! I remember this might work too! But sadly, the result is still the same. It is still returning a string value of 1. – gibo May 28 '19 at 23:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.