Drupal 7 file_entity modul frissítés után tartalom szerkesztéskor, a képeknél a title, alt mezők kitöltött feliratai eltűnnek, ha mentem a tartalmat. A megoldás a file_entity modulban lévő file_entity_file.inc néhány sorának módosítása, a drupal.org oldalon található patch szerint.
diff --git a/file_entity.file.inc b/file_entity.file.inc
index 82dcad7..96c5a1e 100644
--- a/file_entity.file.inc
+++ b/file_entity.file.inc
@@ -287,18 +287,22 @@ function file_entity_set_title_alt_properties($files, $language = NULL) {
if (!empty($alt)) {
$output = token_replace($alt, array('file' => $file), $replace_options);
- // @todo Remove once https://www.drupal.org/node/1713164 is fixed.
- // There is currently no way to get the raw alt text returned from the
- // token so we revert the encoding done during tokenization.
- $file->alt = decode_entities($output);
+ if (!empty($output)) {
+ // @todo Remove once https://www.drupal.org/node/1713164 is fixed.
+ // There is currently no way to get the raw alt text returned from the
+ // token so we revert the encoding done during tokenization.
+ $file->alt = decode_entities($output);
+ }
}
if (!empty($title)) {
$output = token_replace($title, array('file' => $file), $replace_options);
- // @todo Remove once https://www.drupal.org/node/1713164 is fixed.
- // There is currently no way to get the raw title text returned from the
- // token so we revert the encoding done during tokenization.
- $file->title = decode_entities($output);
+ if (!empty($output)) {
+ // @todo Remove once https://www.drupal.org/node/1713164 is fixed.
+ // There is currently no way to get the raw title text returned from the
+ // token so we revert the encoding done during tokenization.
+ $file->title = decode_entities($output);
+ }
}
}
}
forrás: Image field alt and title text overridden by file_entity_alt and file_entity_title
























