Skip to content

Commit

Permalink
Merge pull request #39 from experius/feature/removed_unnecessary_404_…
Browse files Browse the repository at this point in the history
…count

[FEATURE][JIRA-123]removed unnecessary 404 counter when url is being …
  • Loading branch information
DRdevil27 authored Mar 26, 2024
2 parents f4338b3 + 04d4175 commit e9805cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
## 1.4.1 (2023-10-26)
## 1.4.2 (2024-03-26)

[View Release]([email protected]:experius/Magento-2-Module-PageNotFound.git/commits/tag/1.4.0)

* [FEATURE][IN23-284] Removed 404 counter when url is being redirected. *(Simon Vianen)*

## 1.4.1 (2024-03-22)

[View Release]([email protected]:experius/Magento-2-Module-PageNotFound.git/commits/tag/1.4.0)

* [FEATURE][IN23-284] Added store view to admin grid with select filter. *(Simon Vianen)*

## 1.4.0 (2023-10-26)
## 1.4.0 (2024-03-20)

[View Release]([email protected]:experius/Magento-2-Module-PageNotFound.git/commits/tag/1.4.0)

* [FEATURE][IN23-325] Added cronjob and command to delete records older than the given days. *(Simon Vianen)*

## 1.3.8 (2023-10-26)
## 1.3.8 (2024-03-15)

[View Release]([email protected]:experius/Magento-2-Module-PageNotFound.git/commits/tag/1.3.8)

Expand Down
10 changes: 9 additions & 1 deletion Observer/Controller/ActionPredispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ protected function savePageNotFound($fromUrl){

$pageNotFoundModel->setStoreId($this->getStoreId());

if($pageNotFoundModel->getId()){
if($pageNotFoundModel->getId() && empty($pageNotFoundModel->getToUrl())){
$count = $pageNotFoundModel->getCount();
$pageNotFoundModel->setCount($count+1);
} elseif($pageNotFoundModel->getId() && !empty($pageNotFoundModel->getToUrl())){
$count = $pageNotFoundModel->getCount();
} else {
$pageNotFoundModel->setFromUrl($fromUrl);
$pageNotFoundModel->setCount(1);
Expand Down Expand Up @@ -210,4 +212,10 @@ protected function getStoreId(): int{
Return $this->storeManager->getStore()->getId() ?: 0;
}

protected function checkIfRedirecrt($fromUrl)
{
$isInDatabase = true;

return $isInDatabase;
}
}

0 comments on commit e9805cf

Please sign in to comment.