magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Catalog Page Empty if "Allow All Products Per Page" is set to "Yes"

Open gwharton opened this issue 2 years ago • 21 comments

Preconditions and environment

  • Magento 2.4.5

Steps to reproduce

Deploy 2.4.5 vanilla Create Test Category Create Test Product in test category Browse to test category page on frontend and ensure product is visible. Set Allow All Products Per Page setting (Config -> Catalog -> Catalog) to Yes image

Clear Cache Browse to test category page on frontend and ensure product is visible.

Expected result

Product is visisble image

Actual result

Product is not visible image

Additional information

No response

Release note

The Category Page is no longer empty when "Allow All Products Per Page" is set to "Yes".

Triage and priority

  • [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [X] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

gwharton avatar Aug 09 '22 17:08 gwharton

Hi @gwharton. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Aug 09 '22 17:08 m2-assistant[bot]

@magento give me 2.4-develop instance

gwharton avatar Aug 09 '22 17:08 gwharton

Hi @gwharton. Thank you for your request. I'm working on Magento instance for you.

Hi @gwharton, here is your Magento Instance: https://80580bda8b630bcd60edf378d7ee89cc.instances.magento-community.engineering Admin access: https://80580bda8b630bcd60edf378d7ee89cc.instances.magento-community.engineering/admin_f594 Login: 9819800a Password: 60d983aa6b1d

Confirmed on magento test instance. image

gwharton avatar Aug 09 '22 17:08 gwharton

Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*

Once all required labels are present, please add Issue: Confirmed label again.

github-jira-sync-bot avatar Aug 09 '22 20:08 github-jira-sync-bot

Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*

Once all required labels are present, please add Issue: Confirmed label again.

github-jira-sync-bot avatar Aug 09 '22 20:08 github-jira-sync-bot

:x: Something went wrong. Cannot create Jira issue.

github-jira-sync-bot avatar Aug 09 '22 20:08 github-jira-sync-bot

:x: Something went wrong. Cannot create Jira issue.

github-jira-sync-bot avatar Aug 09 '22 20:08 github-jira-sync-bot

@magento give me 2.4-develop instance

Kannakiraj123 avatar Aug 10 '22 02:08 Kannakiraj123

Hi @Kannakiraj123. Thank you for your request. I'm working on Magento instance for you.

Hi @Kannakiraj123, here is your Magento Instance: https://80580bda8b630bcd60edf378d7ee89cc.instances.magento-community.engineering Admin access: https://80580bda8b630bcd60edf378d7ee89cc.instances.magento-community.engineering/admin_2746 Login: a54924a7 Password: c03bb7174b87

Workaround:

Override limiter.phtml in your theme:

app/design/frontend/Your/Theme/Magento_Catalog/templates/product/list/toolbar/limiter.phtml

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<?php
/**
 * Product list toolbar
 *
 * @var \Magento\Catalog\Block\Product\ProductList\Toolbar $block
 * @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
 */
?>
<div class="field limiter">
    <label class="label" for="limiter">
        <span><?= $block->escapeHtml(__('Show')) ?></span>
    </label>
    <div class="control">
        <select id="limiter" data-role="limiter" class="limiter-options">
            <?php foreach ($block->getAvailableLimit() as $_key => $_limit):?>
                <option value="<?= $block->escapeHtmlAttr($_key) ?>"
                    <?php if ($block->isLimitCurrent($_key)):?>
                        selected="selected"
                    <?php endif ?>>
                    <?= $block->escapeHtml($_limit) ?>
                </option>
            <?php endforeach; ?>
        </select>
    </div>
    <span class="limiter-text"><?= $block->escapeHtml(__('per page')) ?></span>
</div>

thlassche avatar Aug 10 '22 05:08 thlassche

Having the same issue, apparently the $localeFormatter (which is new in 2.4.5) is not passed to the product/list/toolbar/limiter.phtml template or any other template like product/list/toolbar/amount.phtml or product/price/tier_prices.phtml at all.

Upgrading a webshop to 2.4.5 gives me the error: Warning: Undefined variable $localeFormatter in /var/www/html/vendor/magento/module-catalog/view/frontend/templates/product/list/toolbar/limiter.phtml on line 26

stephansteiner avatar Aug 10 '22 12:08 stephansteiner

Whilst my error was on Line 26, it was because it was trying to parse the phrase "All" as an int. It was expecting all entries of the limiter to be an integer number which it isnt when the setting is set.

I don't seem to be experiencing the $localeFormatter issue which I suspect will be independent of whether the setting is set or not.

gwharton avatar Aug 10 '22 12:08 gwharton

@gwharton Same in my case.

thlassche avatar Aug 11 '22 05:08 thlassche

:x: Something went wrong. Cannot create Jira issue.

github-jira-sync-bot avatar Aug 11 '22 14:08 github-jira-sync-bot

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6384 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Aug 11 '22 14:08 github-jira-sync-bot

:white_check_mark: Confirmed by @sidolov. Thank you for verifying the issue.
Issue Available: @sidolov, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

m2-assistant[bot] avatar Aug 11 '22 14:08 m2-assistant[bot]

:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-6384

github-jira-sync-bot avatar Aug 11 '22 14:08 github-jira-sync-bot

:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-6384

github-jira-sync-bot avatar Aug 11 '22 14:08 github-jira-sync-bot

Closed without a comment? But I see one commit mentioning AC-6384: https://github.com/magento/magento2/commit/bb55549cd3016987663272e7ffe3f452c8d6e40d, so that's probably the fix

hostep avatar Aug 30 '22 18:08 hostep

PR is here https://github.com/magento/magento2/pull/35987

gwharton avatar Aug 30 '22 18:08 gwharton

Which got closed with a comment:

Resolved internally

hostep avatar Aug 30 '22 18:08 hostep

Hello,

As I can see this issue got fixed in the scope of the internal Jira ticket AC-6384 by the internal team Related commits: https://github.com/magento/magento2/search?q=AC-6384&type=commits

Based on the Jira ticket, the target version is 2.4.6.

Thanks

engcom-Hotel avatar Sep 01 '22 12:09 engcom-Hotel

I had the same issue. Can confirm that PR #35987 solves the pagination loading issue.

dragonfly4 avatar Sep 03 '22 13:09 dragonfly4

@dragonfly4, the official fix (which is a better one), is over here: https://github.com/magento/magento2/commit/bb55549cd3016987663272e7ffe3f452c8d6e40d

hostep avatar Sep 05 '22 07:09 hostep

This was obviously patched before 2.4.5-p1 was published but was omitted from the release. If it's due to be published in 2.4.6 like mentioned by @engcom-Hotel this would mean that there won't be a fix before 2.4.5-p2/2.4.6 and the open source release in March 2023. That's quite a long time for a quick fix.

rarog avatar Oct 23 '22 09:10 rarog