Closed (duplicate)
Project:
Drupal core
Version:
main
Component:
entity system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Oct 2014 at 11:21 UTC
Updated:
17 Sep 2026 at 19:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mauzeh commentedComment #2
mauzeh commentedI'm at the sprint at DrupalCon Amsterdam, I'm going to write the test that attempts to set an invalid language code.
Comment #3
mauzeh commentedAdded failing test.
Comment #5
mauzeh commentedAdded constraint validation.
Comment #6
mauzeh commentedChanged / improved inline documentation.
Comment #7
mauzeh commentedComment #11
yched commentedAdding tags.
Also, I have no clue whether this is a good thing to do or if all hell will break lose, but if we do this, it should be done by having LanguageItem implement OptionsProviderInterface.
Comment #12
yched commentedUpdated summary with the OptionsProviderInterface approach.
Comment #13
mauzeh commentedRewrote the patch, the LanguageItem now implements OptionsProviderInterface.
I'm not too happy about simply calling \Drupal::service('language_manager'); in order to retrieve the list of allowed languages. Feels dirty to access a global scope. Perhaps there is a better way of doing it?
Comment #15
vijaycs85#13 - How about this one?
Comment #17
gábor hojtsyFieldItemBase also uses
\Drupal::entityManager()directly already. Don't seem like there would be a way to inject services in a straightforward fashion.Still several fails on existing tests. EntitiyValidationTest and UserValidationTest. Invalid languages used?
Comment #18
gábor hojtsyClearly nobody is working on this.
Comment #22
dagmarReferenced from #2872790: Deprecate \Drupal\Core\Field\FieldItemBase::generateSampleValue.
Comment #33
smustgrave commentedThank you for reporting this problem. We rely on issue reports like this one to resolve bugs and improve Drupal core.
Since there has been no activity here for over 8 years we are asking if this problem persists on a currently supported version of Drupal. To help, add a comment explaining if the problem still occurs or not. Any extra detail you can provide can help others who experienced this.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #35
smustgrave commentedThis actually appears to have been implemented in #2851736: Language reference fields do not implement OptionsProviderInterface Going to close this one out.