Add support for base fields

Created on 2 September 2022, over 2 years ago
Updated 30 December 2023, 12 months ago

Problem/Motivation

Currently, it's not possible to use the field widget with base fields like for example the node author field.

Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • @philipnorton42 opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇬🇧United Kingdom philipnorton42 Cheshire

    Hi!

    Thanks very much for creating this module, I really like the idea and there's a lot of work been done already on it.

    I had a go with the fix you added here, and although it prevented the crash it did still have one or two issues. I've fixed these and added a small fix to the src/Plugin/Field/FieldWidget/Bert.php class that was uncovered after fixing the original issue.

    I have pushed the fix to the fork that you created, so I've added a merge request as well. The fork was a little out of date with the main 2.x branch so I merged that in too.

    The site I am working with now has user autocomplete fields working nicely for both the core fields and extra fields added.

  • 🇬🇧United Kingdom philipnorton42 Cheshire

    I was doing some testing on this today and realised that if a bundle with an entity is added to the field then the page crashes, I've pushed a fix for that so it works with non-bundle and bundle entities.

  • 🇧🇪Belgium dieterholvoet Brussels

    Could you clarify why exactly the changes in Bert.php are necessary? I just tested only the changes to bert.module and I seem to be able to change the node author widget to bert, change the author of a node and save it. What issues did you encounter exactly and how can I reproduce them?

    I'm not sure about this code, creating an entity using a random bundle from the allowed target bundles:

    $entityBundles = $items->getItemDefinition()['settings']['handler_settings']['target_bundles'];
    $entityBundle = reset($entityBundles);
    
  • 🇬🇧United Kingdom philipnorton42 Cheshire

    It's interesting you should say that the code in Bert.php doesn't seem to be needed. I wonder if it's a side effect of broken configuration that I've just worked around on my local setup?

    Let me do some investigation and check that.

  • Status changed to Needs work 12 months ago
Production build 0.71.5 2024