KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Lot's of notices in our Sentry system regarding querybuilder SQL.php #1646

Open APP opened this topic on on Oct 5, 2020 - 2 comments

APP commented on Oct 5, 2020

We are using :

    "koolreport/core":"4.5.1",
    "koolreport/querybuilder":"2.5.0",

and get a lot of notice errors in our central Sentry system:

Could you please fix them. should be an easy fix.

David Winterburn commented on Oct 5, 2020

Hi,

Would you please post your php code using QueryBuilder for us to replicate the error? Thanks!

APP commented on Oct 5, 2020
  public function getData()
    {

        // Reusable components.
        $sqlUnsubscribeRequests = (new Query())
            ->from('order_item')
            ->selectRaw('IF(course.id IS NOT NULL,course.stop_request_date,course_subscription.stop_date)')->alias('gewenste_stopdatum')
            ->selectRaw('IF(course.id IS NOT NULL,course.stop_reason,course_subscription.stop_reason)')->alias('reden')
            ->selectRaw('CONCAT_WS(" ",NULLIF(auth_user.salutation,""), NULLIF(auth_user.firstname,""), NULLIF(auth_user.infix,""), NULLIF(auth_user.lastname,""))')->alias('naam')
            ->select('coursegroup.name')->alias('cursus')
            ->leftJoin('auth_user', 'auth_user.user_id', 'order_item.person_id')
            ->leftJoin('course', 'course.id', 'order_item.sub_item_id')
            ->leftJoin('course_subscription', 'course_subscription.id', 'order_item.subscription_id')
            ->leftJoin('coursegroup', 'coursegroup.id', 'order_item.item_id')
            ->where('order_item.status', '=', 'stop_requested')
            ->where('order_item.deleted', '=', 0);

        // Append filters.
        if(!empty($this->exportFilters['providerIdWithoutAll']['value'])) {
            $sqlUnsubscribeRequests->where('order_item.provider_id', '=', $this->exportFilters['providerIdWithoutAll']['value']);

            // currentyear opzoeken
            $arr_current_year = \VugronDefinedYear::getCurrentYear($this->exportFilters['providerIdWithoutAll']['value']);
            $sqlUnsubscribeRequests->where('coursegroup.year_id', '=', $arr_current_year['year_id']);

        }

        $rsUnsubscribeRequests = $this->dbConnection->query($sqlUnsubscribeRequests->toMySQL());
        $arrData = $rsUnsubscribeRequests->fetchAll(MDB2_FETCHMODE_ASSOC);

        return $arrData;

    }

from the ->toMySQL() execution it throws the notice.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None