File tree 4 files changed +13
-12
lines changed
src/Revolution/Processors/Element
4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change 24
24
$ _lang ['plugin_err_duplicate ' ] = 'An error occurred while trying to duplicate the plugin. ' ;
25
25
$ _lang ['plugin_err_nf ' ] = 'Plugin not found! ' ;
26
26
$ _lang ['plugin_err_ns ' ] = 'Plugin not specified. ' ;
27
- $ _lang ['plugin_err_ns_name ' ] = 'Please specify a name for the plugin. ' ;
27
+ $ _lang ['plugin_err_ns_name ' ] = 'Please specify a name for this plugin. ' ;
28
28
$ _lang ['plugin_err_remove ' ] = 'An error occurred while trying to delete the plugin. ' ;
29
29
$ _lang ['plugin_err_save ' ] = 'An error occurred while saving the plugin. ' ;
30
30
$ _lang ['plugin_event_err_duplicate ' ] = 'An error occurred while trying to duplicate the plugin events ' ;
Original file line number Diff line number Diff line change 23
23
$ _lang ['snippet_err_locked ' ] = 'This snippet is locked for editing. ' ;
24
24
$ _lang ['snippet_err_nf ' ] = 'Snippet not found! ' ;
25
25
$ _lang ['snippet_err_ns ' ] = 'Snippet not specified. ' ;
26
- $ _lang ['snippet_err_ns_name ' ] = 'Please specify a name for the snippet. ' ;
26
+ $ _lang ['snippet_err_ns_name ' ] = 'Please specify a name for this snippet. ' ;
27
27
$ _lang ['snippet_err_remove ' ] = 'An error occurred while trying to delete the snippet. ' ;
28
28
$ _lang ['snippet_err_save ' ] = 'An error occurred while saving the snippet. ' ;
29
29
$ _lang ['snippet_execonsave ' ] = 'Execute snippet after saving. ' ;
Original file line number Diff line number Diff line change @@ -86,15 +86,15 @@ public function beforeSave()
86
86
$ this ->object ->set ('description ' , $ description );
87
87
}
88
88
89
- $ name = $ this ->getProperty ($ this ->elementNameField , '' );
90
-
91
89
/* verify element has a name and that name does not already exist */
92
90
91
+ $ name = $ this ->getProperty ($ this ->elementNameField , '' );
92
+
93
93
if (empty ($ name )) {
94
94
$ this ->addFieldError ($ this ->elementNameField , $ this ->modx ->lexicon ($ this ->objectType . '_err_ns_name ' ));
95
95
} else {
96
96
if ($ this ->alreadyExists ($ name )) {
97
- $ this ->modx -> error -> addField (
97
+ $ this ->addFieldError (
98
98
$ this ->elementNameField ,
99
99
$ this ->modx ->lexicon ($ this ->objectType . '_err_ae ' , ['name ' => $ name ])
100
100
);
Original file line number Diff line number Diff line change @@ -86,13 +86,14 @@ public function beforeSave()
86
86
$ name = $ this ->getProperty ($ this ->elementNameField , '' );
87
87
88
88
if (empty ($ name )) {
89
- $ this ->addFieldError ($ nameField , $ this ->modx ->lexicon ($ this ->objectType . '_err_ns_name ' ));
90
- } else if ($ this ->alreadyExists ($ name )) {
91
- /* if changing name, but new one already exists */
92
- $ this ->modx ->error ->addField (
93
- $ nameField ,
94
- $ this ->modx ->lexicon ($ this ->objectType . '_err_ae ' , ['name ' => $ name ])
95
- );
89
+ $ this ->addFieldError ($ this ->elementNameField , $ this ->modx ->lexicon ($ this ->objectType . '_err_ns_name ' ));
90
+ } else {
91
+ if ($ this ->alreadyExists ($ name )) {
92
+ $ this ->addFieldError (
93
+ $ this ->elementNameField ,
94
+ $ this ->modx ->lexicon ($ this ->objectType . '_err_ae ' , ['name ' => $ name ])
95
+ );
96
+ }
96
97
}
97
98
98
99
/* category */
You can’t perform that action at this time.
0 commit comments