-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpanopoly_magic-reusable-fpp-admin-title-2813395.patch
35 lines (33 loc) · 1.72 KB
/
panopoly_magic-reusable-fpp-admin-title-2813395.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff --git a/panopoly_magic.module b/panopoly_magic.module
index 0d0113b..1dec9e7 100644
--- a/panopoly_magic.module
+++ b/panopoly_magic.module
@@ -855,7 +855,9 @@ function panopoly_magic_form_fieldable_panels_panes_fieldable_panels_pane_conten
}
// Add custom validation function for the reusable title
- $form['reusable']['admin_title']['#element_validate'][] = 'panopoly_magic_reusable_entity_validate';
+ if (!(!empty($form_state['triggering_element']) && $form_state['triggering_element']['#value'] == 'Update Preview')) {
+ $form['admin']['admin_title']['#element_validate'][] = 'panopoly_magic_reusable_entity_validate';
+ }
// Customize the view mode setting
if (!empty($form['view_mode'])) {
@@ -887,10 +889,6 @@ function panopoly_magic_form_fieldable_panels_panes_fieldable_panels_pane_conten
$form['reusable']['#type'] = '';
$form['reusable']['#title'] = '';
$form['reusable']['reusable']['#title'] = t('Make this reusable');
- $form['reusable']['admin_title']['#field_prefix'] = t('Admin Title');
- $form['reusable']['admin_title']['#title'] = '';
- $form['reusable']['admin_title']['#size'] = '';
- $form['reusable']['admin_title']['#description'] = '';
$form['widget_settings']['reusable'] = $form['reusable'];
unset($form['reusable']);
}
@@ -1500,7 +1498,7 @@ function panopoly_magic_reusable_entity_validate($element, &$form_state, $form)
if (!empty($form_state['values']['reusable'])) {
// Ensure a title is present.
if (empty($element['#value'])) {
- form_error($element, t('If you would like this entity to be reusable, please add a title.'));
+ form_error($element, t('Please add an administrative title to make this entity reusable.'));
}
}
}