Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
translation_entity.module
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Dec 2012 at 06:55 UTC
Updated:
29 Jul 2014 at 21:39 UTC
Follow up for #1831530: Entity translation UI in core (part 2)
@sun and @catch concern about the notice confusing the site administrator.
And, @plach
we don't want the page response to break just because an entity is not translatable when it should be.
Use a watchdog error instead of
+++ b/core/modules/translation_entity/translation_entity.installundefined
@@ -6,6 +6,33 @@
/**
+ * Implements hook_requirements().
+ */
+function translation_entity_requirements($phase) {
+ $requirements = array();
+ $t = get_t();
+
+ if ($phase == 'runtime') {
+ $entity_types = translation_entity_types_translatable();
+ foreach (entity_get_info() as $entity_type => $info) {
+ if (translation_entity_enabled($entity_type)) {
+ if (!isset($entity_types[$entity_type])) {
+ $label = isset($info['label']) ? $info['label'] : $entity_type;
+ $t_args = array('@entity_type' => $label);
+ $requirements['translation_entity_' . $entity_type] = array(
+ 'title' => $t('@entity_type translation', $t_args),
+ 'value' => $t('The entities of type @entity_type do not define a valid base path: it will not be possible to translate them.', $t_args),
+ 'severity' => REQUIREMENT_WARNING,
+ );
+ }
+ }
+ }
+ }
+
+ return $requirements;
+}
Take out the notice and add the watchdog.
No UI changes.
No API change.
in #1831530-34: Entity translation UI in core (part 2)
better with a watchdog error. We don't want the page response to break just because an entity is not translatable when it should be.
Comments
Comment #1
plachThis has been addressed in #1831530: Entity translation UI in core (part 2).
Comment #2
yesct commented:)