Skip to content

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

@revoltek-daniel

Description

@revoltek-daniel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions