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

[BUGFIX] Count doesn't work with group by columns. This fix keeps the group by #1404

Merged
merged 7 commits into from
Mar 10, 2021
Merged

Conversation

dbachmann
Copy link
Contributor

@dbachmann dbachmann commented Jan 19, 2021

Some extensions like the Amasty Product Alerts Reports didn't worked correct because they use some group by statements in their queries. I've attached two screenshots.

Here is a stock alerts report before the fix
without-fix

Here is a stock alert report after the fix
with-fix

The second commit contains a fix for the onepage checkout. The base template used a fieldset as wrapper for payment methods in checkout. That is not correct because payment methods are defined as dt and dd.

@github-actions github-actions bot added Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* labels Jan 19, 2021
@Flyingmana
Copy link
Contributor

Thank you, looks like a good addition.
But we should check if this has somehow the potential for an SQL injection (iam not good enough into the DB Abstraction to know if reusing the group part is safe there)

…ection. When using definition term and definition description this items should be located in a definition list.
@github-actions github-actions bot added Component: Checkout Relates to Mage_Checkout Template : base Relates to base template labels Jan 20, 2021
@dbachmann
Copy link
Contributor Author

The second commit contains a fix for the onepage checkout. The base template used a fieldset as wrapper for payment methods in checkout. That is not correct because payment methods are defined as dt and dd.

@colinmollenhour
Copy link
Member

Good observation, @Flyingmana, the group part is usually quoted (in _renderGroup):

            $group = array();
            foreach ($this->_parts[self::GROUP] as $term) {
                $group[] = $this->_adapter->quoteIdentifier($term, true);
            }
            $sql .= ' ' . self::SQL_GROUP_BY . ' ' . implode(",\n\t", $group);

@dbachmann
Copy link
Contributor Author

@colinmollenhour What would you suggest or what would you change?

@colinmollenhour
Copy link
Member

Can you please remove the commits that are unrelated?

…yments section. When using definition term and definition description this items should be located in a definition list."

This reverts commit 345ab99.
@github-actions github-actions bot removed Template : base Relates to base template Component: Checkout Relates to Mage_Checkout labels Feb 23, 2021
@dbachmann
Copy link
Contributor Author

@colinmollenhour Done

Copy link
Member

@colinmollenhour colinmollenhour left a comment

Choose a reason for hiding this comment

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

Looks good!

@dbachmann
Copy link
Contributor Author

@Flyingmana Could you take a look?

@Flyingmana Flyingmana merged commit fd5796b into OpenMage:1.9.4.x Mar 10, 2021
@github-actions
Copy link
Contributor

Unit Test Results

1 files  ±0  1 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
2 runs  ±0  2 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit fd5796b. ± Comparison against base commit 62d9431.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants