File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
app/code/Magento/PageBuilder
Controller/Adminhtml/Template Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -185,16 +185,15 @@ public function execute()
185
185
*/
186
186
private function validate (RequestInterface $ request )
187
187
{
188
+ $ name = trim ($ request ->getParam (TemplateInterface::KEY_NAME , "" ));
188
189
// If we're missing required data return an error
189
- if (trim ($ request ->getParam (TemplateInterface::KEY_NAME , "" )) === ""
190
- || !$ request ->getParam (TemplateInterface::KEY_TEMPLATE )
191
- ) {
190
+ if ($ name === "" || !$ request ->getParam (TemplateInterface::KEY_TEMPLATE )) {
192
191
throw new LocalizedException (__ ('A required field is missing. ' ));
193
192
}
194
193
195
194
// Verify a template of the same name does not already exist
196
195
$ searchCriteria = $ this ->searchCriteriaBuilder
197
- ->addFilter (TemplateInterface::KEY_NAME , $ request -> getParam (TemplateInterface:: KEY_NAME ) )
196
+ ->addFilter (TemplateInterface::KEY_NAME , $ name )
198
197
->create ();
199
198
$ results = $ this ->templateRepository ->getList ($ searchCriteria );
200
199
if ($ results ->getTotalCount () > 0 ) {
Original file line number Diff line number Diff line change 8
8
9
9
namespace Magento \PageBuilder \Ui \Component \Template ;
10
10
11
+ use Magento \Cms \Ui \Component \AddFilterInterface ;
11
12
use Magento \Framework \Api \Filter ;
12
13
use Magento \Framework \Api \FilterBuilder ;
13
14
use Magento \Framework \Api \Search \SearchCriteriaBuilder ;
Original file line number Diff line number Diff line change 522
522
<item name =" html_display_content_type" xsi : type =" string" >html</item >
523
523
<item name =" template_types" xsi : type =" array" >
524
524
<item name =" any" xsi : type =" string" >Any</item >
525
- <item name =" cms_page " xsi : type =" string" >Page</item >
526
- <item name =" catalog_product " xsi : type =" string" >Product</item >
527
- <item name =" catalog_category " xsi : type =" string" >Category</item >
528
- <item name =" cms_block " xsi : type =" string" >Block</item >
525
+ <item name =" page " xsi : type =" string" >Page</item >
526
+ <item name =" product " xsi : type =" string" >Product</item >
527
+ <item name =" category " xsi : type =" string" >Category</item >
528
+ <item name =" block " xsi : type =" string" >Block</item >
529
529
<item name =" dynamic_block" xsi : type =" string" >Dynamic Block</item >
530
530
</item >
531
531
</argument >
You can’t perform that action at this time.
0 commit comments