Skip to content

Commit 73d5afa

Browse files
authored
Merge pull request #378 from mageplaza/2.4-develop
2.4 develop
2 parents d626d48 + dbcf7c2 commit 73d5afa

File tree

15 files changed

+26
-55
lines changed

15 files changed

+26
-55
lines changed

Api/Data/SearchResult/CategorySearchResultInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ public function getItems();
3838
* @param \Mageplaza\Blog\Api\Data\CategoryInterface[] $items
3939
* @return $this
4040
*/
41-
public function setItems(array $items = null);
41+
public function setItems(?array $items = null);
4242
}

Api/Data/SearchResult/CommentSearchResultInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ public function getItems();
3838
* @param \Mageplaza\Blog\Api\Data\CommentInterface[] $items
3939
* @return $this
4040
*/
41-
public function setItems(array $items = null);
41+
public function setItems(?array $items = null);
4242
}

Api/Data/SearchResult/PostSearchResultInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ public function getItems();
3838
* @param \Mageplaza\Blog\Api\Data\PostInterface[] $items
3939
* @return $this
4040
*/
41-
public function setItems(array $items = null);
41+
public function setItems(?array $items = null);
4242
}

Api/Data/SearchResult/TagSearchResultInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ public function getItems();
3838
* @param \Mageplaza\Blog\Api\Data\TagInterface[] $items
3939
* @return $this
4040
*/
41-
public function setItems(array $items = null);
41+
public function setItems(?array $items = null);
4242
}

Api/Data/SearchResult/TopicSearchResultInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ public function getItems();
3838
* @param \Mageplaza\Blog\Api\Data\TopicInterface[] $items
3939
* @return $this
4040
*/
41-
public function setItems(array $items = null);
41+
public function setItems(?array $items = null);
4242
}

Model/Author.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public function __construct(
6060
Context $context,
6161
Registry $registry,
6262
Data $helperData,
63-
AbstractResource $resource = null,
64-
AbstractDb $resourceCollection = null,
63+
?AbstractResource $resource = null,
64+
?AbstractDb $resourceCollection = null,
6565
array $data = []
6666
) {
6767
$this->helperData = $helperData;

Model/Category.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ public function __construct(
138138
CategoryFactory $categoryFactory,
139139
CollectionFactory $postCollectionFactory,
140140
CategoryCollectionFactory $categoryCollectionFactory,
141-
AbstractResource $resource = null,
142-
AbstractDb $resourceCollection = null,
141+
?AbstractResource $resource = null,
142+
?AbstractDb $resourceCollection = null,
143143
array $data = []
144144
) {
145145
$this->categoryFactory = $categoryFactory;

Model/Comment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public function __construct(
8989
Registry $registry,
9090
CollectionFactory $postCollectionFactory,
9191
CommentCollectionFactory $commentCollectionFactory,
92-
AbstractResource $resource = null,
93-
AbstractDb $resourceCollection = null,
92+
?AbstractResource $resource = null,
93+
?AbstractDb $resourceCollection = null,
9494
array $data = []
9595
) {
9696
$this->postCollectionFactory = $postCollectionFactory;

Model/Import/AbstractImport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ public function __construct(
195195
HelperData $helperData,
196196
StoreManagerInterface $storeManager,
197197
HelperImage $helperImage,
198-
AbstractResource $resource = null,
199-
AbstractDb $resourceCollection = null,
198+
?AbstractResource $resource = null,
199+
?AbstractDb $resourceCollection = null,
200200
array $data = []
201201
) {
202202
$this->date = $date;

Model/Post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ public function __construct(
243243
CategoryCollectionFactory $categoryCollectionFactory,
244244
PostCollectionFactory $postCollectionFactory,
245245
ProductCollectionFactory $productCollectionFactory,
246-
AbstractResource $resource = null,
247-
AbstractDb $resourceCollection = null,
246+
?AbstractResource $resource = null,
247+
?AbstractDb $resourceCollection = null,
248248
array $data = []
249249
) {
250250
$this->tagCollectionFactory = $tagCollectionFactory;

Model/ResourceModel/PostHistory/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public function __construct(
7171
LoggerInterface $logger,
7272
FetchStrategyInterface $fetchStrategy,
7373
ManagerInterface $eventManager,
74-
AdapterInterface $connection = null,
75-
AbstractDb $resource = null
74+
?AdapterInterface $connection = null,
75+
?AbstractDb $resource = null
7676
) {
7777
$this->localeDate = $localeDate;
7878
$this->locale = $localeResolver->getLocale();

Model/Tag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ public function __construct(
106106
Registry $registry,
107107
CollectionFactory $postCollectionFactory,
108108
TagCollectionFactory $tagCollectionFactory,
109-
AbstractResource $resource = null,
110-
AbstractDb $resourceCollection = null,
109+
?AbstractResource $resource = null,
110+
?AbstractDb $resourceCollection = null,
111111
array $data = []
112112
) {
113113
$this->postCollectionFactory = $postCollectionFactory;

Model/Topic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ public function __construct(
118118
Registry $registry,
119119
CollectionFactory $postCollectionFactory,
120120
TopicCollectionFactory $topicCollectionFactory,
121-
AbstractResource $resource = null,
122-
AbstractDb $resourceCollection = null,
121+
?AbstractResource $resource = null,
122+
?AbstractDb $resourceCollection = null,
123123
array $data = []
124124
) {
125125
$this->postCollectionFactory = $postCollectionFactory;

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"name": "mageplaza/magento-2-blog-extension",
33
"description": "Magento 2 Blog extension",
44
"require": {
5-
"mageplaza/module-core": "^1.5.10",
6-
"mageplaza/facebook-graph-sdk": "^1.0.1"
5+
"mageplaza/module-core": "^1.5.13",
6+
"mageplaza/facebook-graph-sdk": "^1.0.2"
77
},
88
"type": "magento2-module",
9-
"version": "4.2.7",
9+
"version": "4.2.8",
1010
"license": "proprietary",
1111
"keywords": [
1212
"magento 2",

view/adminhtml/web/category/edit.js

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,17 @@
1919
*/
2020

2121
define([
22-
'jquery',
23-
'prototype',
24-
'extjs/ext-tree-checkbox'
22+
'jquery'
2523
], function (jQuery) {
2624

27-
var categorySubmit = function (url, useAjax) {
25+
var categorySubmit = function () {
2826
var activeTab = $('active_tab_id');
2927
if (activeTab) {
3028
if (activeTab.tabsJsObject && activeTab.tabsJsObject.tabs('activeAnchor')) {
3129
activeTab.value = activeTab.tabsJsObject.tabs('activeAnchor').prop('id');
3230
}
3331
}
3432

35-
var params = {};
36-
var fields = $('category_edit_form').getElementsBySelector('input', 'select');
37-
for (var i = 0; i < fields.length; i++) {
38-
if (!fields[i].name) {
39-
continue;
40-
}
41-
params[fields[i].name] = fields[i].getValue();
42-
}
43-
44-
// Get info about what we're submitting - to properly update tree nodes
45-
var categoryId = params['category[id]'] ? params['category[id]'] : 0;
46-
var isCreating = categoryId == 0; // Separate variable is needed because '0' in javascript converts to TRUE
47-
var path = params['category[path]'].split('/');
48-
var parentId = path.pop();
49-
if (parentId == categoryId) { // Maybe path includes Blog Category id itself
50-
parentId = path.pop();
51-
}
52-
53-
// Make operations with Blog Category tree
54-
if (isCreating) {
55-
if (!Ext.tree.currentNodeId) {
56-
// First submit of form - select some node to be current
57-
Ext.tree.currentNodeId = parentId;
58-
}
59-
Ext.tree.addNodeTo = parentId;
60-
}
61-
6233
// Submit form
6334
jQuery('#category_edit_form').trigger('submit');
6435
};

0 commit comments

Comments
 (0)