Skip to content

Custom table attributes in custom entry sources #16256

Closed Answered by brandonkelly
jamesmacwhite asked this question in Q&A
Discussion options

You must be logged in to vote

The selectable custom fields are based on which field layouts the element type says are available to the source. That’s defined by Element::defineFieldLayouts(). The base implementation in craft\base\Element will return all field layouts associated with the element type, however the method is overridden by Asset, Category, and Entry, in such a way that didn’t consider that the source key could have been defined via EVENT_REGISTER_SOURCES. So when an unexpected source key was passed, an empty array was returned rather than falling back to the default behavior.

I’ve fixed that for the next Craft 4 and 5 releases (3a34393 + 00a6feb). So going forward, if a source key is passed to defineField…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@AugustMiller
Comment options

@jamesmacwhite
Comment options

@AugustMiller
Comment options

@jamesmacwhite
Comment options

Comment options

You must be logged in to vote
2 replies
@jamesmacwhite
Comment options

@brandonkelly
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants