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

Fixed price filter when search by non-numeric value #3136

Merged
merged 2 commits into from
Apr 12, 2023
Merged

Fixed price filter when search by non-numeric value #3136

merged 2 commits into from
Apr 12, 2023

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Apr 4, 2023

Description (*)

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes TypeError: Unsupported operand types: int * string #3135

Manual testing scenarios (*)

  1. go to admin manage products
  2. filter price by non-numeric value

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added the Component: Adminhtml Relates to Mage_Adminhtml label Apr 4, 2023
m-overlund
m-overlund previously approved these changes Apr 4, 2023
Copy link
Contributor

@m-overlund m-overlund left a comment

Choose a reason for hiding this comment

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

Fixes the issue

addison74
addison74 previously approved these changes Apr 4, 2023
@colinmollenhour colinmollenhour changed the base branch from 1.9.4.x to main April 4, 2023 16:49
@colinmollenhour colinmollenhour dismissed stale reviews from addison74 and m-overlund April 4, 2023 16:49

The base branch was changed.

@colinmollenhour colinmollenhour changed the base branch from main to 1.9.4.x April 4, 2023 16:49
luigifab
luigifab previously approved these changes Apr 5, 2023
Copy link
Contributor

@luigifab luigifab left a comment

Choose a reason for hiding this comment

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

I can now filter by price with "a" and "b".
Only products with a price of 0 are displayed, instead of an error.

image

@fballiano
Copy link
Contributor

this PR has to be rebased on main

m-overlund
m-overlund previously approved these changes Apr 5, 2023
@sreichel
Copy link
Contributor Author

sreichel commented Apr 5, 2023

I thought patches go to v19?

@fballiano
Copy link
Contributor

patches will be backported from main to the v19 branch. 1.9.4.x is to be deleted as soon as all PRs are rebased: OpenMage/rfcs#10 (comment)

@sreichel sreichel changed the base branch from 1.9.4.x to main April 7, 2023 22:23
@sreichel sreichel dismissed stale reviews from m-overlund and luigifab April 7, 2023 22:23

The base branch was changed.

@sreichel sreichel changed the base branch from main to 1.9.4.x April 7, 2023 22:24
@sreichel
Copy link
Contributor Author

sreichel commented Apr 7, 2023

I know why @colinmollenhour reverted this ... :P

addison74
addison74 previously approved these changes Apr 8, 2023
Copy link
Contributor

@addison74 addison74 left a comment

Choose a reason for hiding this comment

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

I checked initially the reported issue. I confirm after testing that this PR solves it. Not only for NULL value but for others values like strings.

@luigifab - Filtering for price from a to b I am getting "No records found."

luigifab
luigifab previously approved these changes Apr 10, 2023
Copy link
Contributor

@luigifab luigifab left a comment

Choose a reason for hiding this comment

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

You're right no records found... with main branch, but I still get free products with my store. There may be other changes elsewhere.

@addison74
Copy link
Contributor

@luigifab - There is no need to do other checks. I confirm your issue here #3158.

@sreichel
Copy link
Contributor Author

@addison74 confirm this as intended. This PR was just to fix the error.

@addison74
Copy link
Contributor

@sreichel - I approved this PR created by you precisely because it solves the previously reported issue (#3135). I confirmed a new issue and I created a ticket in this regard, so that another PR can solve this one as well.

@fballiano
Copy link
Contributor

Screenshot 2023-04-10 alle 16 16 55

can't merge on this branch

m-overlund
m-overlund previously approved these changes Apr 11, 2023
@colinmollenhour
Copy link
Member

I know why @colinmollenhour reverted this ... :P

Sorry, I used this PR as a guinnea pig to see if I could successfully rebase PRs of other authors - I can edit the base branch but it doesn't modify any commits so it just creates a huge mess.. AFAIK the only way to do it is manual rebase and then change the PR base as detailed here: OpenMage/rfcs#10 (comment)

@sreichel
Copy link
Contributor Author

sreichel commented Apr 11, 2023

Githubs "squash merge" should do the same. Not? Just reverted base branch b/c off created mass.

@luigifab
Copy link
Contributor

At localhost, I using git rebase -i main other_branch, then I remove lines of unneeded commits, then I change base branch on github, then I push -f.

@colinmollenhour
Copy link
Member

Githubs "squash merge" should do the same. Not? Just reverted base branch off created mass.

The potential for conflicts that git cannot auto-fix safely between 1.9.4.x and main is very high, but there are also many commit differences between 1.9.4.x and 20.0 (the origin of main) so when you change the PR base it shows hundreds of additional commits.. Unfortuantely I think the manual rebase is the only option, I couldn't find any other way. Creating a new PR with cherry-pick would be another way but I think that just creates more clutter in the issue tracker and divides the conversation.

@colinmollenhour
Copy link
Member

2023-04-12_15-35-26.mp4

@fballiano fballiano merged commit ff22957 into OpenMage:main Apr 12, 2023
@fballiano
Copy link
Contributor

@colinmollenhour how do you push? cause I get a 403 when I try

@colinmollenhour
Copy link
Member

@colinmollenhour how do you push? cause I get a 403 when I try

You had "mixed roles" so maybe that was the cause.. I removed the conflict favoring the more elevated role so maybe it will work now? You have to be a maintainer of some degree to push on other people's PRs and the author has to have to have selected "Allow edits and access to secrets by maintainers"

@sreichel
Copy link
Contributor Author

@colinmollenhour how do you push? cause I get a 403 when I try

Mhh, you should be able to push?!? Thanks @colinmollenhour .

@sreichel sreichel deleted the hotfix/filter-product-price-by-string branch April 13, 2023 00:05
@fballiano
Copy link
Contributor

@colinmollenhour thanks Colin, sadly didn't fix it:

fab@MBP-Fab ~/P/magento-lts (patch-8)> gpp
remote: Permission to loekvangool/magento-lts.git denied to fballiano.
fatal: unable to access 'https://github.com/loekvangool/magento-lts.git/': The requested URL returned error: 403

I think it's something regarding the way I authenticate on github but I can't find any doc about that :-\

@colinmollenhour
Copy link
Member

I think it's something regarding the way I authenticate on github but I can't find any doc about that :-\

I always use SSH, not sure if that explains it.. I added the origin using the SSH url before pushing.

@sreichel
Copy link
Contributor Author

@fballiano can please backport this?

@fballiano
Copy link
Contributor

is this to be considered a significant regression or a vulnerability fix as per https://github.com/OpenMage/rfcs/blob/main/accepted/0002-release-schedule.md?

@sreichel
Copy link
Contributor Author

Y, it is. Dont want to fix an error on admins catalog product grid?

@fballiano
Copy link
Contributor

Thats not the point. Anyway you should have the privileges to cherry pick a commit to v19 branch

@addison74
Copy link
Contributor

... but we cannot tell those who still use v19 to cherry pick individually PRs.

@fballiano
Copy link
Contributor

What? Sven can cherry pick and commit it if he desires, not users. He is a maintainer.

@sreichel
Copy link
Contributor Author

this PR has to be rebased on main

...

@fballiano
Copy link
Contributor

you see, you keep reading everything in every post and just creating arguments. I've commented multiple times that I cannot (for some reason) push on other people's repo. so i cannot rebase it on main.

also, I'm more than willing to do that (if I could) for "normal users" but a maintainer (although you made it really clear we were not interested in collaborating with us anymore) can do it himself in 2 minutes.

@colinmollenhour
Copy link
Member

@sreichel Fabrizio's comment saying it needed to be rebased on main was before it was merged. Anyway, I just cherry-picked it into v19.

In the future, after it has been merged into main if you want it backported please create a new PR for backporting (unless it is an urgent security matter then a maintainer will probably cherry-pick and backport immediately anyway). Perhaps we can use a label like "PATCH" to indicate if a PR should be backported at the time of merging..

But on that note, please observe that the RFC does state "functionality: if it doesn't fix a significant regression, it doesn't get a PATCH" - so I think it stretching a bit to justify a backport by that definition in this case. Let's try to adhere to the RFC more strictly going forward. Using the main branch is intended to be the way to take advantage of all of the various improvements whereas v19 is just on critical life support for those that are content with what they have and want minimal change. Of course there is always a third option which is to cherry-pick commits into your own repo to your liking, this is one reason we use Squash and Merge so that you can cherry-pick PRs easily. That's also useful for running unmerged fixes in production while we all argue about the minutia. 🤣

@colinmollenhour
Copy link
Member

After just running into #3129 I understand this issue more now and it is definitely related to PHP 8+ which I somehow missed before - my apologies for overlooking this.

So this bug was not a regression so to speak but a result of support for a new PHP version - while this is not explicitly covered in the RFC I think it does make sense to treat bugs that are a result of forced PHP updates (7.4 is no longer supported so v19 must support at least PHP 8.0) the same as a regression and backport PATCH updates accordingly to ensure a supported version of PHP is always supported by supported versions of OpenMage.

In my opinion old MAJOR branches (e.g. v19) do not need to be updated to support bleeding edge PHP versions so when PHP 8.0 is EOL and PHP 8.3 is released on 26 Nov 2023, v19 should continue to receive updates to support PHP 8.1 and 8.2 (since it was already claimed to be supported at one point) but if PHP 8.3 requires significant updates these would not be considered PATCH updates so v19 will not support PHP 8.3.

As an aside, the single-command dev/openmage/install.sh dev environment was updated to support PHP 8.2 which is also the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Adminhtml Relates to Mage_Adminhtml Rebased: RFC-0002 This PR has been rebased onto either 'main' or 'next' according to RFC-0002
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: Unsupported operand types: int * string
6 participants