1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* MagePrince |
4
|
|
|
* |
5
|
|
|
* NOTICE OF LICENSE |
6
|
|
|
* |
7
|
|
|
* This source file is subject to the mageprince.com license that is |
8
|
|
|
* available through the world-wide-web at this URL: |
9
|
|
|
* https://mageprince.com/end-user-license-agreement |
10
|
|
|
* |
11
|
|
|
* DISCLAIMER |
12
|
|
|
* |
13
|
|
|
* Do not edit or add to this file if you wish to upgrade this extension to newer |
14
|
|
|
* version in the future. |
15
|
|
|
* |
16
|
|
|
* @category MagePrince |
17
|
|
|
* @package Mageprince_Faq |
18
|
|
|
* @copyright Copyright (c) MagePrince (https://mageprince.com/) |
19
|
|
|
* @license https://mageprince.com/end-user-license-agreement |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
namespace Mageprince\Faq\Controller\Adminhtml\FaqGroup; |
23
|
|
|
|
24
|
|
|
use Magento\Backend\App\Action\Context; |
|
|
|
|
25
|
|
|
use Magento\Framework\Controller\ResultFactory; |
|
|
|
|
26
|
|
|
use Magento\Framework\View\Result\PageFactory; |
|
|
|
|
27
|
|
|
use Mageprince\Faq\Model\FaqGroupRepository; |
28
|
|
|
|
29
|
|
|
class Edit extends FaqGroup |
30
|
|
|
{ |
31
|
|
|
/** |
32
|
|
|
* @var PageFactory |
33
|
|
|
*/ |
34
|
|
|
protected $resultPageFactory; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var FaqGroupRepository |
38
|
|
|
*/ |
39
|
|
|
protected $faqGroupRepository; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Edit constructor. |
43
|
|
|
* @param Context $context |
44
|
|
|
* @param PageFactory $resultPageFactory |
45
|
|
|
* @param FaqGroupRepository $faqGroupRepository |
46
|
|
|
*/ |
47
|
|
|
public function __construct( |
48
|
|
|
Context $context, |
49
|
|
|
PageFactory $resultPageFactory, |
50
|
|
|
FaqGroupRepository $faqGroupRepository |
51
|
|
|
) { |
52
|
|
|
$this->resultPageFactory = $resultPageFactory; |
53
|
|
|
$this->faqGroupRepository = $faqGroupRepository; |
54
|
|
|
parent::__construct($context); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public function execute() |
58
|
|
|
{ |
59
|
|
|
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */ |
60
|
|
|
$resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE); |
61
|
|
|
$resultPage->setActiveMenu('Mageprince_Faq::menu'); |
62
|
|
|
|
63
|
|
|
if ($faqGroupId = (int)$this->getRequest()->getParam('faqgroup_id')) { |
64
|
|
|
try { |
65
|
|
|
$faqGroup = $this->faqGroupRepository->getById($faqGroupId); |
66
|
|
|
$resultPage->getConfig()->getTitle()->prepend(__($faqGroup->getGroupName())); |
|
|
|
|
67
|
|
|
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) { |
|
|
|
|
68
|
|
|
$this->messageManager->addErrorMessage(__('This Faq Group no longer exists.')); |
69
|
|
|
|
70
|
|
|
return $this->_redirect('*/*/index'); |
71
|
|
|
} |
72
|
|
|
} else { |
73
|
|
|
$resultPage->getConfig()->getTitle()->prepend(__('New Faq Group')); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
return $resultPage; |
77
|
|
|
} |
78
|
|
|
} |
79
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths