Skip to content

Commit

Permalink
Merge pull request #17 from PrestaShop/dev
Browse files Browse the repository at this point in the history
Release 2.0.1
  • Loading branch information
PierreRambaud authored Dec 15, 2021
2 parents 94c4e14 + 0088f95 commit b0a8ebd
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 14 deletions.
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-----------------------------------------------------------------------------
Thank you for contributing to the PrestaShop project!
Please take the time to edit the "Answers" rows below with the necessary information.
Check out our contribution guidelines to find out how to complete it:
https://devdocs.prestashop.com/1.7/contribute/contribution-guidelines/#pull-requests
------------------------------------------------------------------------------>

| Questions | Answers
| ------------- | -------------------------------------------------------
| Description? | Please be specific when describing the PR. <br> Every detail helps: versions, browser/server configuration, specific module/theme, etc. Feel free to add more information below this table.
| Type? | bug fix / improvement / new feature / refacto / critical
| BC breaks? | yes / no
| Deprecations? | yes / no
| Fixed ticket? | Fixes PrestaShop/Prestashop#{issue number here}.
| How to test? | Please indicate how to best verify that this PR is correct.

<!-- Click the form's "Preview" button to make sure the table is functional in GitHub. Thank you! -->
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
target-branch: dev
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
target-branch: dev
14 changes: 14 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
branches:
- master
name-template: v$NEXT_PATCH_VERSION
tag-template: v$NEXT_PATCH_VERSION
categories:
- title: 🚀 Improvements
label: enhancement
- title: 🐛 Bug Fixes
label: bug
change-template: '- #$NUMBER: $TITLE by @$AUTHOR'
template: |
# Changes
$CHANGES
3 changes: 0 additions & 3 deletions CHANGELOG.txt

This file was deleted.

16 changes: 16 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GitHub contributors:
--------------------------------
- AntoineMille
- Caleydon
- Francois Gaillard
- Gregory Roussac
- Jerome Nadaud
- Jérôme Nadaud
- Maxime Biloé
- Quetzacoalt91
- aleeks
- antoin-m
- eternoendless
- gaillafr
- maximebiloe
- xBorderie
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## About

Adds a tab to the Stats dashboard, showing the pages requested by your visitors that have not been found.
Enrich your stats, display the pages requested by your visitors that could not be found.

## Reporting issues

Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>pagesnotfound</name>
<displayName><![CDATA[Pages not found]]></displayName>
<version><![CDATA[2.0.0]]></version>
<version><![CDATA[2.0.1]]></version>
<description><![CDATA[Displays the pages requested by your visitors that have not been found.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[analytics_stats]]></tab>
Expand Down
Binary file modified logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 8 additions & 9 deletions pagesnotfound.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,25 @@ public function __construct()
{
$this->name = 'pagesnotfound';
$this->tab = 'analytics_stats';
$this->version = '2.0.0';
$this->version = '2.0.1';
$this->author = 'PrestaShop';
$this->need_instance = 0;

parent::__construct();

$this->displayName = $this->trans('Pages not found', array(), 'Modules.Pagesnotfound.Admin');
$this->description = $this->trans('Adds a tab to the Stats dashboard, showing the pages requested by your visitors that have not been found.', array(), 'Modules.Pagesnotfound.Admin');
$this->description = $this->trans('Enrich your stats, display the pages requested by your visitors that could not be found.', array(), 'Modules.Pagesnotfound.Admin');
$this->ps_versions_compliancy = array('min' => '1.7.1.0', 'max' => _PS_VERSION_);
}

public function install()
{
if (defined(_PS_VERSION_) && version_compare(_PS_VERSION_, '1.5.0.1', '>=')) {
$hookName = 'displayTop';
} else {
$hookName = 'top';
}
if (!parent::install() || !$this->registerHook($hookName) || !$this->registerHook('AdminStatsModules'))
if (!parent::install()
|| !$this->registerHook('displayTop')
|| !$this->registerHook('AdminStatsModules')
) {
return false;
}

return Db::getInstance()->execute(
'CREATE TABLE `'._DB_PREFIX_.'pagenotfound` (
Expand Down Expand Up @@ -178,7 +177,7 @@ public function hookAdminStatsModules()
return $this->html;
}

public function hookTop($params)
public function hookDisplayTop($params)
{
if (strstr($_SERVER['REQUEST_URI'], '404.php') && isset($_SERVER['REDIRECT_URL']))
$_SERVER['REQUEST_URI'] = $_SERVER['REDIRECT_URL'];
Expand Down
32 changes: 32 additions & 0 deletions upgrade/upgrade-2.0.1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @author PrestaShop SA <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/

/**
* @param Module $module
*
* @return bool
*/
function upgrade_module_2_0_1($module)
{
$module->unregisterHook('top');
$module->registerHook('displayTop');

return true;
}

0 comments on commit b0a8ebd

Please sign in to comment.