Skip to content

Commit 8a7bbac

Browse files
committed
updated code compatible with php 8.2
1 parent 5784bb1 commit 8a7bbac

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

Block/Adminhtml/Post/Edit/Tab/Content.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ protected function _prepareForm()
8181
]
8282
);
8383

84-
85-
8684
$contentField = $fieldset->addField(
8785
'short_content',
8886
'editor',
@@ -101,10 +99,10 @@ protected function _prepareForm()
10199
);
102100

103101
$wysiwygConfig = $this->_wysiwygConfig->getConfig(['tab_id' => $this->getTabId().time()]);
104-
if (!$this->getData('is_valid') && !$this->getData('local_valid')) {
102+
/* if (!$this->getData('is_valid') && !$this->getData('local_valid')) {
105103
$wysiwygConfig['enabled'] = $wysiwygConfig['add_variables'] = $wysiwygConfig['add_widgets'] = $wysiwygConfig['add_images'] = 0;
106104
$wysiwygConfig['plugins'] = [];
107-
}
105+
} */
108106

109107
$contentField = $fieldset->addField(
110108
'content',

Controller/Router.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function match(RequestInterface $request)
192192
$urlKeys = explode("/", $urlKey);
193193
$latestPageRoute = $_blogHelper->getConfig('blog_latest_page/route');
194194
$urlKeysOrgin = $urlKeys;
195-
$urlKeysOrgin = str_replace($urlSuffix, "", $urlKeysOrgin);
195+
$urlKeysOrgin = $urlSuffix ? str_replace($urlSuffix, "", $urlKeysOrgin) : $urlKeysOrgin;
196196
$orig_list_authors_url = $urlPrefix."/author/list";
197197

198198
if($urlPrefix == '') {
@@ -202,7 +202,7 @@ public function match(RequestInterface $request)
202202

203203

204204
// LATEST PAGE
205-
if(count($urlKeys) == 1 && $urlPrefix != '' && (str_replace($urlSuffix, "", $urlKeys[0]) == $urlPrefix)){
205+
if(count($urlKeys) == 1 && $urlPrefix != '' && (@str_replace($urlSuffix, "", $urlKeys[0]) == $urlPrefix)){
206206
$request->setModuleName('vesblog')
207207
->setControllerName('latest')
208208
->setActionName('view');
@@ -217,7 +217,7 @@ public function match(RequestInterface $request)
217217

218218
// CATEGORY PAGE
219219
if(count($urlKeys)==2 && $urlPrefix == $urlKeys[0] && $urlKeys[1]!='' && $this->endsWith($urlKeys[1], $urlSuffix)){
220-
$alias = str_replace($urlSuffix, "", $urlKeys[1]);
220+
$alias = @str_replace($urlSuffix, "", $urlKeys[1]);
221221
$category = $this->_category->getCollection()
222222
->addFieldToFilter('identifier', $alias)
223223
->addFieldToFilter('is_active', 1)
@@ -241,7 +241,7 @@ public function match(RequestInterface $request)
241241
// AUTHORS PAGE
242242
if(($orig_list_authors_url == $urlKey) || (count($urlKeys)==2 && $urlPrefix == $urlKeys[0] && $urlKeys[1]!='')){
243243

244-
$authors_route = str_replace($urlSuffix, "", $urlKeys[1]);
244+
$authors_route = @str_replace($urlSuffix, "", $urlKeys[1]);
245245
if($authors_route && ($authors_route == $authorsUrlPrefix)){
246246
$request->setModuleName('vesblog')
247247
->setControllerName('authors')
@@ -263,7 +263,7 @@ public function match(RequestInterface $request)
263263
$urlKeys[0] = '';
264264
}
265265
if(count($urlKeys)==3 && $urlPrefix == $urlKeys[0] && $urlKeys[1]=='archive'){
266-
$alias = str_replace($urlSuffix, "", $urlKeys[2]);
266+
$alias = @str_replace($urlSuffix, "", $urlKeys[2]);
267267
$date = explode('-', $alias);
268268
$date[2] = '01';
269269
$time = strtotime(implode('-', $date));
@@ -290,7 +290,7 @@ public function match(RequestInterface $request)
290290
$urlKeys[0] = '';
291291
}
292292
if(count($urlKeys)==3 && $urlPrefix == $urlKeys[0] && $urlKeys[1]=='tag'){
293-
$alias = str_replace($urlSuffix, "", $urlKeys[2]);
293+
$alias = @str_replace($urlSuffix, "", $urlKeys[2]);
294294
$tagCollection = $this->_tag->getCollection()
295295
->addFieldToFilter("alias", $alias);
296296
if(!empty($tagCollection)){
@@ -323,7 +323,7 @@ public function match(RequestInterface $request)
323323

324324
// AUTHOR PAGE
325325
if(count($urlKeys)==3 && $urlPrefix == $urlKeys[0] && $urlKeys[1]=='author') {
326-
$alias = str_replace($urlSuffix, "", $urlKeys[2]);
326+
$alias = @str_replace($urlSuffix, "", $urlKeys[2]);
327327
$author = $this->_author->loadByUserName($alias);
328328
$is_view = null;
329329
if($author) {
@@ -418,8 +418,8 @@ public function match(RequestInterface $request)
418418
$is_post_uri = true;
419419
}
420420
}
421-
if($is_post_uri){
422-
$alias = str_replace($urlSuffix, "", $urlKeys[2]);
421+
if($is_post_uri) {
422+
$alias = @str_replace($urlSuffix, "", $urlKeys[2]);
423423
if ($storeCode = $request->getParam(\Magento\Store\Api\StoreResolverInterface::PARAM_NAME)) {
424424
$store = $this->storeManager->getStore($storeCode);
425425
if ($store->getId()) {
@@ -464,7 +464,7 @@ public function match(RequestInterface $request)
464464

465465
/** ENABLE CATEGORY IN POST URL */
466466
if ($categoriesUrls && count($urlKeys)==2 && $urlPrefix == $urlKeys[0] && $urlKeys[1]!='' && $this->endsWith($urlKeys[1], $urlSuffix)) {
467-
$alias = str_replace($urlSuffix, "", $urlKeys[1]);
467+
$alias = @str_replace($urlSuffix, "", $urlKeys[1]);
468468
$post = $this->_post->getCollection()
469469
->addFieldToFilter("is_active", 1)
470470
->addFieldToFilter("identifier", $alias)

view/frontend/templates/post/view.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ $show_createdtime = $helper->getConfig("post_page/show_createdtime");
3030
$show_hits = $helper->getConfig("post_page/show_hits");
3131
$show_tags = $helper->getConfig("post_page/show_tags");
3232
$show_socialnetworks = $helper->getConfig("post_page/show_socialblock");
33+
$show_socialnetworks = false;
3334
$_post->setData('categories', $_post->getPostCategories());
3435
?>
3536
<?php $postUrl = $helper->getPostUrl($_post); ?>
@@ -169,7 +170,7 @@ $_post->setData('categories', $_post->getPostCategories());
169170
</div>
170171
<?php } ?>
171172
<?php } ?>
172-
<?php if($show_socialnetworks && $networks){ ?>
173+
<?php if($show_socialnetworks && $networks) { ?>
173174
<div class="post-social post-bottom">
174175
<span class="td-post-share-title"><?= __('SHARE'); ?></span>
175176
<!-- Go to www.addthis.com/dashboard to customize your tools -->

0 commit comments

Comments
 (0)