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

Sort by position does not work #2511

Closed
sreichel opened this issue Aug 29, 2022 · 5 comments · Fixed by #2637
Closed

Sort by position does not work #2511

sreichel opened this issue Aug 29, 2022 · 5 comments · Fixed by #2637

Comments

@sreichel
Copy link
Contributor

Preconditions (*)

  1. 1.9.4.x-dev
  2. flat product tables enabed

Steps to reproduce (*)

        $collection = Mage::getResourceModel('catalog/product_collection')
            ->addCategoryFilter(Mage::getModel('catalog/category')->load(3))
            ->addAttributeToSort('position')
            ->load();
        var_dump($collection->getFirstItem()->getData());
Column not found: 1054 Unknown column 'cat_index.position' in 'order clause' ...

This works only for flat tables turned off.

There is a PR that fix this, but it does not work for me. See #1815

@elidrissidev
Copy link
Member

From my testing, this error happens only when flat tables are ON and category filter is either not applied or category not found. Can you try commenting out the 3 lines below and see if your issue is resolved? Then I can create a PR.

if ($this->isEnabledFlat()) {
$this->getSelect()->order("cat_index_position {$dir}");
}

@sreichel
Copy link
Contributor Author

When i comment these line the error disappears ... not tested anything more.

@elidrissidev
Copy link
Member

Why do you close this? The fix is not merged yet

@addison74
Copy link
Contributor

It is most likely the way in which Sven expresses his dissatisfaction with how this project is managed. Unfortunately, I cannot hide the fact that such actions which are repeated periodically affect me emotionally, especially since I still believe in OpenMage. I think that others are in the same situation.

@sreichel
Copy link
Contributor Author

sreichel commented Jan 23, 2023

@elidrissidev i closed it b/c i dont we to see it anymore when viewing https://github.com/issues. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants