If no section is present and the button to create a section is clicked:
Error message:
Invalid argument supplied for foreach() An error occurred in
/extensions/meta_section/extension.driver.php
around line 131
extension.driver.php
Line 131:
foreach ($sections as $section) {
Line 120:
$sections = $sectionManager->fetch(NULL, 'ASC', 'name');
// $sections is “false“
Solution:
public function customizeEssentials($context) {
// Get sections
$sectionManager = new SectionManager($this->_Parent);
$sections = $sectionManager->fetch(NULL, 'ASC', 'name');
// Check whether sections are available
if (false === $sections) {
return null;
}
// Load HTML from context
$dom = @DOMDocument::loadHTML($context['output']);
$xpath = new DOMXPath($dom);
If no section is present and the button to create a section is clicked:
Error message:
extension.driver.php
Line 131:
Line 120:
Solution: