Be sure to checkout our newest add-on Reading Time Pro!

EE4 compatibility updates:

  • Publisher is EE4 and EE5 compatible, but it does not currently support the Fluid field (it's in the works).
  • Reel is EE4 and EE5 compatible, but it does not currently support the Fluid field.

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)

Jun 11, 2019

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

Jun 11, 2019

int(1)

#3

BoldMinded (Brian)

Jun 11, 2019

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

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

Dan Munday

Jun 11, 2019

still
int(1)

#5

Dan Munday

Jun 11, 2019

#6

BoldMinded (Brian)

Jun 11, 2019

$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

Jun 11, 2019

i did not remove anything.

#8

Dan Munday

Jun 11, 2019

#9

BoldMinded (Brian)

Jun 11, 2019

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

Jun 11, 2019

it prints
array(0) { }

#11

Dan Munday

Jun 11, 2019

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

Jun 11, 2019

it is back to array(0) { } now

#13

BoldMinded (Brian)

Jun 11, 2019

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

Jun 11, 2019

yeah. it works

Login to reply

Contact

For add-on support, please use the Support section. General inquries and pre-sale questions can be sent to support@boldminded.com.