craft-linkfield icon indicating copy to clipboard operation
craft-linkfield copied to clipboard

Server error when selecting entry

Open PhilRedm opened this issue 2 years ago • 6 comments

Craft 4.0.1 Typed link field 2.1.1-rc

I've created a link field that supports selecting Craft entries. When clicking the "Choose" button when "Entry" is selected as the link type I get 'A server error occurred' warning in the CP and the entry list is not displayed. Also the link type selector is not defaulting to the selected link type, which is 'Entry' in this case, but instead displays '(No Link)'. I've tried deleting the field and recreating it but get the same result.

PhilRedm avatar May 07 '22 16:05 PhilRedm

Have the very same issue. Same version nrs. I've included the error log if that helps. web-2022-05-07.log

eheiser avatar May 07 '22 16:05 eheiser

I have the same error. I think it comes down to this error:

[web.ERROR] [yii\base\UnknownPropertyException] yii\base\UnknownPropertyException: Setting unknown property: craft\elements\db\EntryQuery::enabledForSite

luke-nehemedia avatar May 07 '22 17:05 luke-nehemedia

I assume @d--j has resolved this issue with tis pull request: https://github.com/sebastian-lenz/craft-linkfield/pull/218

A new version was just published, das the problem exists with the new version?

sebastian-lenz avatar May 08 '22 13:05 sebastian-lenz

The new version fixed the server error for me. However, I'm still not seeing the default link type I selected when setting up the field. Not a major issue for me anyway.

eheiser avatar May 08 '22 13:05 eheiser

Same for me. I can choose an entry now, but the selected default link type is not displayed. Not a big problem.

PhilRedm avatar May 08 '22 15:05 PhilRedm

Hm, the issue with the default type seems to be an old one and was introduced when we added the "No link" type. The code currently applies the "No link" type too early, we now suppress that behavior on elements that are being created.

sebastian-lenz avatar May 09 '22 08:05 sebastian-lenz