cancel
Showing results for 
Search instead for 
Did you mean: 

You cannot define a correlation name 'store_table' more than once

You cannot define a correlation name 'store_table' more than once

We are using Magento 2.3.2 enterprise edition, we have created a new website, created a new user and role as well.

For that role keep role scope as custom and select only the newly created website, and in role resources select the content section.

After that login as the new user and click on content->pages/content->blocks I'm seeing this zend exception "You cannot define a correlation name 'store_table' more than once".

Can anyone know about this and what might be the fix for this.

8 REPLIES 8

Re: You cannot define a correlation name 'store_table' more than once

Hello,

 

Seems like you are using some third-party module and it is creating issue,

 

please try to find such a module and disable it.

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: You cannot define a correlation name 'store_table' more than once

Hi sunil

I have checked the same issue with default Magento 2.3.2 EE.

I am getting same issueScreenshot (20).png.

Re: You cannot define a correlation name 'store_table' more than once

Hi sunil,

I have checked the same issue with default Magento 2.3.2 EE.

I am getting same issueScreenshot (20).png.

Re: You cannot define a correlation name 'store_table' more than once

Hello @vinod_kumar22 

 

Are you using fresh DB as well?

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: You cannot define a correlation name 'store_table' more than once

Yes sunil fresh db( default magento 2.3.2)

Re: You cannot define a correlation name 'store_table' more than once

Did you ever figure this out, @vinod_kumar22

 

I've got a similar situation in 2.3.3 Commerce (EE).

Re: You cannot define a correlation name 'store_table' more than once


@vinod_kumar22  ha escrito:

We are using Magento 2.3.2 enterprise edition, we have created a new website, created a new user and role as well.

For that role keep role scope as custom and select only the newly created website, and in role resources select the content section.

After that login as the new user and click on content->pages/content->blocks I'm seeing this zend exception "You cannot define a correlation name 'store_table' more than once".

Can anyone know about this and what might be the fix for this.


@Sunil Patel @vinod_kumar22 

Good estimates I am presenting the same problem.

 

Magento see. 2.2.10

 

They could give you a solution or guide me of what could be the inconvenience.

 

I await your comments

regards

Re: You cannot define a correlation name 'store_table' more than once

Hi,

 

We faced the same issue when created a custom role for a specific store. After debugging this, I found that the problem is on the plugin  

 

vendor/magento/module-admin-gws/Plugin/CollectionFilter.php

 

In beforeLoadWithFilter, this line

 

$collection->addStoreFilter($this->role->getStoreIds());

 

is executed 2 times. This is defined in:

 

 

#vendor/magento/module-cms/Model/ResourceModel/Page/Collection.php
public function addStoreFilter($store, $withAdmin = true)
{
  if (!$this->getFlag('store_filter_added')) { 
    $this->performAddStoreFilter($store, $withAdmin);
  }
  return $this;
}

The problem is that the store_filter_added flag is never initialized.

 

 

This was fixed in this commit https://github.com/magento/magento2/commit/21cbf17130ac362c91cd0e1a46c5aa3e43f0df4d in Magento 2.3.4

 

In order to fix this, we patched the file vendor/magento/module-cms/Model/ResourceModel/Page/Collection.php adding this

 

$this->setFlag('store_filter_added', true);

 

Hope this helps someone else

 

Regards