Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Clicking the setting icon (gear) in the control panel returns errors

Status Resolved
Add-on / Version Reading Time Pro 1.0
Severity
EE Version 5.2.3

Dan Munday

Jun 11, 2019

After the installation, clicking the Add-on setting icon (the gear icon) will return errors.

I have created a Reading Time Pro custom field naming it “reading time” and assigned this field to a Blog Channel.
I place the parameter, “calculate_reading_time=“yes” wpm=“150”” inside the Channel Entry Tag and the template properly populates the right value.

The only issue I encounter is that I was not able to access the add-on configuration.

Video:
https://www.dropbox.com/s/78etnpkld4fjh5y/boldminded-reading-pro.mov?dl=0

#1

BoldMinded (Brian)

In the Service/EntryResult.php file add this var_dump and let me know what the value is when you reload the settings page.

public function getEntries($entryIds = [])
    {
        $fields = $fieldId = ee('Model')->get('ChannelField')
            ->with('Channels')
            ->filter('field_type', READING_TIME_PRO_NAME_VAR)
            ->all();
        
        var_dump(count($fields)); die; // <----- add this line
#2

Dan Munday

int(1)

#3

BoldMinded (Brian)

Ok, further down after the $plucked line add this:

$plucked = $field->Channels->pluck('channel_id');
var_dump($plucked); die;
#4

Dan Munday

still int(1)

#5

Dan Munday

https://www.dropbox.com/s/7l5szi7rd1kwleu/Screen%20Shot%202019-06-11%20at%2012.36.51%20PM.png?dl=0

#6

BoldMinded (Brian)

$plucked should be an array, not an int. Did you remove the first var_dump? It should print something like this:

array (size=1)
  0 => int 3
#7

Dan Munday

i did not remove anything.

#8

Dan Munday

https://www.dropbox.com/s/k0e4co9457uu1lc/Screen%20Shot%202019-06-11%20at%2012.47.03%20PM.png?dl=0

#9

BoldMinded (Brian)

The first var_dump on line 61 is what is printing, you need to remove that. It’s not making it to the 2nd var_dump.

#10

Dan Munday

it prints array(0) { }

#11

Dan Munday

I logged out and refreshed the cp and then clicked the settings icon and then it prints the following again. int(1)

#12

Dan Munday

it is back to array(0) { } now

#13

BoldMinded (Brian)

Ok, I think this will fix it. Change line 64 that contains “$plucked =” to this:

$plucked = $field->getAllChannels()->pluck('channel_id');

And remove the var_dumps.

#14

Dan Munday

yeah. it works

Login to reply