• Resolved fbrusis

    (@fbrusis)


    Hi,
    after installing I got warning on creating default object in db-class.php. Login to my wp-backend was not possible any more. I fixed it myself in this way.

    Error:
    Warning: Creating default object from empty value in ../plugins/final-tiles-grid-gallery-lite/lib/db-class.php on line 152

    Warning: Cannot modify header information – headers already sent by (output started at ../plugins/final-tiles-grid-gallery-lite/lib/db-class.php:152) in ../wp-admin/includes/misc.php on line 1196

    Fix: add line 152: if(isset($data->Id))

    Modified function getGalleries():
    public function getGalleries()
    {
    global $wpdb;
    $tb_g = $wpdb->prefix . “FinalTiles_gallery”;
    $tb_i = $wpdb->prefix . “FinalTiles_gallery_images”;

    $query = “SELECT Id, configuration FROM $tb_g order by id”;
    $galleryResults = $wpdb->get_results( $query );

    $result = array();
    foreach($galleryResults as $gallery)
    {
    $data = json_decode($gallery->configuration);
    if(isset($data->Id)) /* new added by myself */
    $data->Id = $gallery->Id;
    $result[] = $data;
    }
    return $result;
    }

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Warning: creating default object db-class.php’ is closed to new replies.