Closed janstoeckler closed 8 years ago
Uhm, a reference to what exactly? It's just a path, there is no reference to something else?
I was thinking to the Redirect entity?
We are the redirect entity, we can't reference ourself?
I may be misunderstanding the way \Drupal\redirect\Plugin\Field\FieldType\RedirectSourceItem is supposed to be used. I was under the (possibly mistaken) impression that field was provided so it could be added to content entities for adding redirects from the comfort of the /{entity-type}/edit page in addition to the global redirect configuration page. To that end, I intend to "add"/create non-existing Redirect entities in that same context, a task that could be simplified if the RedirectSourceItem-field was to extend EntityReference.
Maybe, very possibly, I'm just entirely missing how this module is supposed to work.
No, it has nothing to do with that :)
It's a field that the redirect entity itself uses to store the source path of the redirect. It's not meant to be used elsewhere.
We should add a no_ui = TRUE flag to the annotation.
Ah, that makes sense. Would you be interested in such a field (addable to entities) as part of this module, though?
Not sure, what exactly would that do as opposed to a normal entity reference? Does it actually need to be referenced or could you just have a UI component that displays redirects that are related to an entity based on the destination path?
Hello all, is there a particular architectural reason for the field not extending EntityReference? I'm currently working on adding some logic to the provided field (https://github.com/janstoeckler/redirect/tree/field-enhancement) and was thinking about possibly using Entity Reference instead of extending FieltItemBase.
Are there any pros or cons I might be missing?