- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2018
11:15 AM
10-03-2018
11:15 AM
Hi, any idea?
Preconditions
Starting from Magento CE 2.2.5
upgrade from 2.2.5 to 2.2.6
Steps to reproduce
Starting from Magento CE 2.2.5
created a terms and conditions (Store-->Terms and conditions)
upgrade from 2.2.5 to 2.2.6
The Terms and conditions created are not visible in admin (Store-->Terms and conditions)
Expected result
I can edit the old terms and conditions
I can insert a new terms and conditions
Actual result
old terms and conditions are not visible
In production mode I can add a new terms and conditions but is not visible in admin
In developer mode there is an exception:
2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'XXXXXX.checkout_agreement_store' doesn't exist, query was: SELECT agreement_store.* FROM checkout_agreement_store AS agreement_store WHERE (agreement_store.agreement_id IN ('1'))
Exception #1 (PDOException): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'XXXXXX.checkout_agreement_store' doesn't exist
The table exist in DB; note that in sql there isn't the prefix to table.
Preconditions
Starting from Magento CE 2.2.5
upgrade from 2.2.5 to 2.2.6
Steps to reproduce
Starting from Magento CE 2.2.5
created a terms and conditions (Store-->Terms and conditions)
upgrade from 2.2.5 to 2.2.6
The Terms and conditions created are not visible in admin (Store-->Terms and conditions)
Expected result
I can edit the old terms and conditions
I can insert a new terms and conditions
Actual result
old terms and conditions are not visible
In production mode I can add a new terms and conditions but is not visible in admin
In developer mode there is an exception:
2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'XXXXXX.checkout_agreement_store' doesn't exist, query was: SELECT agreement_store.* FROM checkout_agreement_store AS agreement_store WHERE (agreement_store.agreement_id IN ('1'))
Exception #1 (PDOException): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'XXXXXX.checkout_agreement_store' doesn't exist
The table exist in DB; note that in sql there isn't the prefix to table.
Solved! Go to Solution.
Labels:
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2018
03:11 PM
10-03-2018
03:11 PM
HI,
I find the issue and the solution
In /vendor/magento/module-checkout-agreements/Model/ResourceModel/Agreement/Grid/Collection.php
There is an issue:
private function getStoresForAgreements() { $agreementId = $this->getColumnValues('agreement_id'); if (!empty($agreementId)) { $select = $this->getConnection()->select()->from( ['agreement_store' => 'checkout_agreement_store'] )->where( 'agreement_store.agreement_id IN (?)', $agreementId ); return $this->getConnection()->fetchAll($select); } return []; }
Change with
private function getStoresForAgreements() { $agreementId = $this->getColumnValues('agreement_id'); if (!empty($agreementId)) { $select = $this->getConnection()->select()->from( [$this->getTable('agreement_store') => $this->getTable('checkout_agreement_store')] )->where( $this->getTable('agreement_store').'.agreement_id IN (?)', $agreementId ); return $this->getConnection()->fetchAll($select); } return []; }
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2018
03:11 PM
10-03-2018
03:11 PM
HI,
I find the issue and the solution
In /vendor/magento/module-checkout-agreements/Model/ResourceModel/Agreement/Grid/Collection.php
There is an issue:
private function getStoresForAgreements() { $agreementId = $this->getColumnValues('agreement_id'); if (!empty($agreementId)) { $select = $this->getConnection()->select()->from( ['agreement_store' => 'checkout_agreement_store'] )->where( 'agreement_store.agreement_id IN (?)', $agreementId ); return $this->getConnection()->fetchAll($select); } return []; }
Change with
private function getStoresForAgreements() { $agreementId = $this->getColumnValues('agreement_id'); if (!empty($agreementId)) { $select = $this->getConnection()->select()->from( [$this->getTable('agreement_store') => $this->getTable('checkout_agreement_store')] )->where( $this->getTable('agreement_store').'.agreement_id IN (?)', $agreementId ); return $this->getConnection()->fetchAll($select); } return []; }