[5.x] Field that is not MultiInstance still uses a different UUID in each field layout #14659
-
While upgrade my Date Range plugin, I ran into the following issue/oddity. The plugin has an EntryQueryBehaviour where the user passes the field's handle (eg In Craft 5, when I get the field through As a work-around, I added a second argument the user has to pass to the behaviour, which is the entryType handle: $type = Craft::$app->getEntries()->getEntryTypeByHandle($this->entryTypeHandle);
$layout = Craft::$app->getFields()->getLayoutById($type->fieldLayoutId);
$this->field = $layout->getFieldByHandle($this->handle); That field does give me a Secondly, when checking the database, the UUID under which the data is stored is different for each entry type - even if the field doesn't have MultiInstance enabled. I'm ok with my workaround but I wanted to make sure that the different UUID for each entry and the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is all working as expected. Each field layout component gets a unique UUID, which custom fields use as their “instance UUID” regardless of whether they’re multi- or single-instance field types. If you are using |
Beta Was this translation helpful? Give feedback.
This is all working as expected. Each field layout component gets a unique UUID, which custom fields use as their “instance UUID” regardless of whether they’re multi- or single-instance field types.
If you are using
valueSql()
, I take it the field is still getting content stored in thecontent
JSON column. So is there a reason the field is limited to be single-instance?