plugin-ShortcodeTracker icon indicating copy to clipboard operation
plugin-ShortcodeTracker copied to clipboard

Error: Call to a member function getIdSubDataTable() on false

Open revoltek-daniel opened this issue 5 months ago • 0 comments

The Return of the getRowFromLabel() call could be false so the method chain will trigger the Error: Call to a member function getIdSubDataTable() on false in https://github.com/mgazdzik/plugin-ShortcodeTracker/blob/master/API.php#L375

The simple fix could be to check if it retuns false, something like:

$shortcodeReportIdSubtable = $eventReport
                        ->getRowFromLabel(ShortcodeTracker::REDIRECT_EVENT_CATEGORY);

if ($shortcodeReportIdSubtable) {
        $shortcodeReportIdSubtable = $shortcodeReportIdSubtable->getIdSubDataTable();
}

But than the false result of this method leads to another error in core/Plugin/Visualization.php:434:

Error: Call to a member function getColumns() on false

I'm not sure what would be the correct empty result here to fix this.

revoltek-daniel avatar Aug 25 '25 09:08 revoltek-daniel