Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix upgrade module to v4 #107

Merged
merged 5 commits into from
Jan 17, 2022
Merged

Conversation

jf-viguier
Copy link
Contributor

@jf-viguier jf-viguier commented Jun 4, 2021

Questions Answers
Description? Add required hooks and configuration values for v4 upgrade
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes PrestaShop/PrestaShop#23218
How to test? see issue

It seems that the upgrade file is not launched at prestashop 1.7 upgrade in some cases. So I added a default commentsPerPage in paginate method

@Progi1984 Progi1984 added the bug label Jun 4, 2021
@jf-viguier
Copy link
Contributor Author

thanks @Progi1984, can you add my 3 pr in this module to 4.2.2 version ?
This pr should fix this pr too #92
(in fact it's just a test to make)

upgrade/install-4.0.0.php Outdated Show resolved Hide resolved
upgrade/install-4.0.0.php Outdated Show resolved Hide resolved
@jf-viguier jf-viguier requested a review from kpodemski June 7, 2021 11:19
@Progi1984 Progi1984 requested a review from PierreRambaud June 8, 2021 08:25
Copy link
Contributor

@matthieu-rolland matthieu-rolland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kpodemski seems like your feedback has been dealt with 👍

@jf-viguier
Copy link
Contributor Author

@kpodemski is it ok now ?

@kpodemski
Copy link
Contributor

@jf-viguier great, thanks 👍

@hibatallahAouadni hibatallahAouadni self-assigned this Jun 10, 2021
@hibatallahAouadni
Copy link

Hello @jf-viguier

I'm really sorry but it seems I have an issue with installing the productcomment module v3.6.1 on 1.6.1.20

image

I tried many times but in vain 😖
Ping @PrestaShop/qa-functional could someone please test this PR cause I can't.

Thanks in advance 🙏

@hibatallahAouadni hibatallahAouadni removed their assignment Jun 30, 2021
@khouloudbelguith khouloudbelguith self-assigned this Jul 15, 2021
@khouloudbelguith
Copy link

Hi @jf-viguier,

I followed these steps:

  1. Install PrestaShop 1.6.1.24

  2. Install module product comment 3.6.0 from GitHub

  3. Add a comment with guest and customer

  4. Approve those comments

  5. Upgrade PrestaShop to PS1.7.7.5 (I found that the productcomment module is upgraded to v4.2.1)

  6. I Upgraded manually the product comment module to this PR (v4.2.2)

  7. Go to FO
    image

  8. View a product with a comment

  9. See error => No comment is displayed
    image

Thanks to check and feedback.

@jf-viguier
Copy link
Contributor Author

@khouloudbelguith have you cleared the ps cache ?

@sarahdib
Copy link

@jf-viguier I have the same bug as @khouloudbelguith and all cache are cleared.

@hibatallahAouadni
Copy link

hibatallahAouadni commented Jan 12, 2022

Ping @PrestaShop/prestashop-core-developers is there any one have an idea about how to test this PR 🙏
I suggest these steps, so can someone check if these are correcte:

  1. Install PS 1.6.1.24
  2. Install Product comments with these cmds:
  • cd /your-shop/modules/
  • git clone https://github.com/PrestaShop/productcomments.git
  • cd productcomments
  • git checkout tags/v3.6.0 -b v3.6.0
  • BO>Module Catalog>Click on install of Product Comments
  1. Create 6 comments with guests and Customers
  2. Approve all
  3. git fetch origin pull/107/head:pr-107 && git checkout pr-107 && git reset --hard && git clean -fd && git rebase origin/dev && composer install
  4. Upgrade the shop to 1.7.8.2
  5. Check the comments in FO

Thanks in advance 🙏

@kpodemski
Copy link
Contributor

@hibatallahAouadni

IMO it's a good scenario for tests 👍

@jf-viguier
Copy link
Contributor Author

The productcomments is updated during pretashop upgrade from addons : so the code of this pr will not be launched, how to solve this @kpodemski ?

@kpodemski
Copy link
Contributor

@jf-viguier hmm, you're right

I think we need to create a package for the module.

  1. composer install
  2. Make a .zip from the productcomments directory. And install this module after the upgrade.

@jf-viguier that should do it, right?

@jf-viguier
Copy link
Contributor Author

@kpodemski I guess no, upgrade/install-4.0.0.php of my pr has to be launched. Prestashop upgrade will upgrade the module to the version 5.

@Progi1984
Copy link
Member

Discussed with @hibatallahAouadni about the process, she will test with this process. Thanks to her.

Copy link

@hibatallahAouadni hibatallahAouadni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello everyone,

Following my steps (mentioned above), I encounter first issue while upgrading:

image

Then, I give the access rights to the module and re-upgrade to 1.7.8.2, and it was a success:

image

As you can see in module manager, the PR is well installed:

image

Clicking on Configure, you could see the 6 created comments before upgrade:

image

But on FO, the block product comments is not displayed:

image

I checked the position of hooks and it seems good to me:

image

I check the table of product_comments, and it seems all good to me:

image

So, @jf-viguier you need to follow my steps to check and fix the issue (the block product comments is not displayed).
Please check and feedback.

Thanks!

@jf-viguier
Copy link
Contributor Author

modules\productcomments\upgrade\install-4.0.0.php is well executed during test steps.

There are two issues with your steps @hibatallahAouadni

  1. After prestashop upgrade, there are some missing hooks for the module (displayRightColumnProduct & displayFooterProduct):
    image

  2. my changes in modules\productcomments\src\Repository\ProductCommentRepository.php are deleted by prestashop upgrade, so you have to update it manually

There is still a javascript error to fix in modules\productcomments\views\templates\hook\product-additional-info-quickview.tpl (remove all script here) and then comments will whow up.

Please check @hibatallahAouadni

@jf-viguier
Copy link
Contributor Author

I've just rebased my pr

Copy link

@hibatallahAouadni hibatallahAouadni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @jf-viguier

After adding this hook displayFooterProduct:

image

All comments are well displayed and the pagination works 💯

pr_107.mp4

LGTM, QA ✔️

Thanks for your hard working 🚀

@jf-viguier
Copy link
Contributor Author

Thanks @hibatallahAouadni

@Progi1984 Progi1984 merged commit 70fcd8b into PrestaShop:dev Jan 17, 2022
@Progi1984
Copy link
Member

Thanks @jf-viguier & @hibatallahAouadni (for the hard work QA on this PR).

@Progi1984 Progi1984 added this to the 5.0.1 milestone Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comment no longer appear after upgrading from 1.6.1.24 to 1.7.7.x
10 participants