Open jenlampton opened 10 years ago
I closed the PR for the D7 equivalent of this at https://github.com/backdrop/backdrop/pull/154. @jenlampton is right that the Drupal.org issue at Add generic field/property getters/setters (with optional language support) for entities has the language methods mixed up with a generic setter/getter API. Let's work on just the generic language method independently for this issue.
We'll also need to add a change record for what to do when you are porting modules that call entity_language()
. Or, maybe we can make that a backwards-compatible wrapper function for $entity->language()
similar to node_save()
.
Or, maybe we can make that a backwards-compatible wrapper function for $entity->language() similar to node_save()
👍 on that.
A PR that contained a solution was closed in 2014, but it's now 2022 and there's still no alternative solution to this problem. Can we maybe revisit merging that PR now, and implementing a different solution in 2.x?
edit: I've rebased the old PR and tests are running now. But I give it little chance of working... It might be better to re-apply the drupal patches against the updated backdrop codebase.
I'm going to exclude the patches in https://drupal.org/node/1495648 which introduced the entity_language() function to D7. It will get the language for any entity.
The Drupal 8 version probably added the language method to the entity object, but it appears to be all mixed up in https://drupal.org/node/1277776. We'll need to sort through that and decide how much we want to include in Backdrop.
Assigning to @quicksketch for review.