Registry Mirror
Skip to content

Undefined index filtering empty result #18

Open

Description

@BernhardK91

Hi there,

I am getting the following error:

Undefined index: DIFFERENZ (View: C:\[...]\resources\views\dashboard\fieldsales.blade.php)

The result of the SQL-query is empty and the problem is occured in the following line:

"dataSource" => $this->dataStore("customer.flop100.annualComparison")->filter('DIFFERENZ', '<', 0),

Thank you in advance!

Activity

  1. BernhardK91 commented on Jan 3, 2019

    @BernhardK91
    Author

    I solved my problem with this workaround:

    if ($this->dataStore("customer.flop100.annualComparison")->count() > 0) {
        Table::create([
            [...]
        ]);
    } else {
        echo '<i>no results</i>';
    }
  2. koolphp commented on Jan 3, 2019

    @koolphp
    Owner

    That's great. The Table actually detect the empty rows of datastore however the issue lies inside the filter() function which have problem if result is empty. May be it is better to return the datastore itself if there is no data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions