Problem/Motivation
Each extra field component ID from this module is prefixed by:
extra_field_
It would be nice and best practice to put this prefix into a constant for easier reuse. For example in extra_field_plus we need the same variable and it's uncool to hardcode it.
Currently can be found in: web/modules/contrib/extra_field/src/Plugin/ExtraFieldManagerBase.php
/**
* Build the field name string.
*
* @param string $pluginId
* The machine name of the Extra Field plugin.
*
* @return string
* Field name.
*/
protected function fieldName($pluginId) {
return 'extra_field_' . $pluginId;
}
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork extra_field-3305672
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
anybodySee the MR for an example. This is not finished. As the same prefix is used at several places, I wasn't sure in which class to put the constant. Or should it be global in the module file? Unsure...
See https://git.drupalcode.org/search?search=extra_field_&nav_source=navbar&...
Comment #4
anybodylol, what happened here... sorry ;) Restoring title.
Comment #5
anybodyThe test error is unrelated to this issue.
Comment #8
sutharsan commentedComment #9
anybodyThank you, @Sutharsan :)
I'll now add the same to extra_field_plus! :) BTW would you like to become Co-Maintainer there? Are you using extra_field_plus?
Comment #10
sutharsan commentedNo, thank you. I’m not using that module.