You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm migrating a D7 project to Backdrop. A form I have allows the user to create a Field Collection, this worked fine in D7. In Backdrop, this error happens:
Error: Cannot access protected property FieldCollectionItemEntity::$langcode
In the function title_entity_language, the line:
$langcode = $entity->langcode;
Is where the error occurs.
In Drupal 7, that line is different now. It is:
$langcode = entity_language($entity_type, $entity);
The text was updated successfully, but these errors were encountered:
The issue at hand is that the FieldCollectionItemEntity class (which extends Entity) uses a private langcode property, which differs from other entities on Backdrop (for example Node uses a public langcode property).
However, FieldCollectionItemEntity does provide a method FieldCollectionItemEntity::langcode() to obtain the langcode from the entity.
The solution here is to modify the code of the Title module to check to see if the property langcode is publicly available, and if not, check to see if there is a langcode() method that should be used instead. Alternatively, the maintainer of Field Collection could perhaps make langcode public.
I see the maintainer of Title is not active currently in the community, but perhaps the @BugSquad can help? (I'm part of the bugsquad).
BTW, entity_language() does not exist in Backdrop.
I'm migrating a D7 project to Backdrop. A form I have allows the user to create a Field Collection, this worked fine in D7. In Backdrop, this error happens:
Error: Cannot access protected property FieldCollectionItemEntity::$langcode
In the function title_entity_language, the line:
$langcode = $entity->langcode;
Is where the error occurs.
In Drupal 7, that line is different now. It is:
$langcode = entity_language($entity_type, $entity);
The text was updated successfully, but these errors were encountered: