Support forums

Please check @brandnewbox_uk for support status updates.

Search     Advanced Search
Requesting hooks to be added to Datagrab - patch included  
Posted: 25 August 2017 02:05 PM —  
Newbie
Rank
Total Posts:  3
Joined  2017-08-25

Hello, Andrew. I’ve been using these hooks for a year or so now in EE2. It would be nice if they were added to the EE3 version so there is better compatibility with Publisher. As you can tell the hooks are nearly identical in what they do, so similar hooks could be added to the other fieldtype adapters as well. Let me know what you think.

(sorry about the noise in the patch file, my IDE wanted to clean up the files)

Profile
 
Posted: 25 August 2017 02:07 PM —   [ # 1 ]  
Newbie
Rank
Total Posts:  3
Joined  2017-08-25

Appears the forum are not allowing me to attach files.

https://www.dropbox.com/s/b9mi1jwt637topq/datagrab-hooks.patch?dl=0

Profile
 
Posted: 28 August 2017 02:01 PM —   [ # 2 ]  
Newbie
Rank
Total Posts:  3
Joined  2017-08-25

Andrew, here is another requested hook for the datagrab_grid.php file:

function _rebuild_grid_data( $entry_id, $DG, $field_id )
    {
        $where = array(
            'entry_id' => $entry_id,
        );

        // -------------------------------------------
        //  'ajw_datagrab_rebuild_grid_query' hook
        //
        if (ee()->extensions->active_hook('ajw_datagrab_rebuild_grid_query'))
        {
            $query = ee()->extensions->call('ajw_datagrab_rebuild_grid_query', $where, $field_id);
        }
        else
        {
            ee()->db->select( "*" );
            ee()->db->from( "exp_channel_grid_field_".$field_id );
            ee()->db->where( "entry_id", $entry_id );
            ee()->db->order_by( "row_order ASC" );
            $query = ee()->db->get();
        }
        //
        // -------------------------------------------

  $grid = array();
  foreach( $query->result_array() as $row ) {
   $row_id = $row["row_id"];
   unset( $row["row_id"] );
   unset( $row["entry_id"] );
   unset( $row["row_order"] );
   $grid[ "row_id_" . $row_id ] = $row;
  }

  return $grid;
 }
Profile
 

‹‹ Getting error when trying to import from an template with the run_saved_import tag in it      Can’t get JSON import working on EE 3 ››

Select A Theme