Hi,
I've been getting this error:
"Undefined index: websites in \vendor\magento\module-catalog\Ui\Component\Listing\Columns\Websites.php on line 83"
before I got the error what I did is. I copied the file ProductDataProvider for me to override,
then when I go to Admin>Catalog>Product I am getting the error stated above.
public function prepareDataSource(array $dataSource) { $websiteNames = []; foreach ($this->getData('options') as $website) { $websiteNames[$website->getWebsiteId()] = $website->getName(); } if (isset($dataSource['data']['items'])) { $fieldName = $this->getData('name'); foreach ($dataSource['data']['items'] as & $item) { $websites = []; foreach ($item[$fieldName] as $websiteId) { if (!isset($websiteNames[$websiteId])) { continue; } $websites[] = $websiteNames[$websiteId]; } $item[$fieldName] = implode(', ', $websites); } } return $dataSource; }
Solved! Go to Solution.
@gerald_cruz1
Can you just revert what you did and check that the error still exist or not if not that means you did some wrong in the customization.
If that help you accept as solution.
@gerald_cruz1
Can you just revert what you did and check that the error still exist or not if not that means you did some wrong in the customization.
If that help you accept as solution.