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: Error posting blog

Status Resolved
Add-on / Version Reading Time Pro 1.0.2
Severity
EE Version 6.0.6

Martijn Broeders

Sep 05, 2021

Testing upgrading my EE from version 5 to 6.

TypeError Caught

Argument 1 passed to Reading_time_pro_ext::after_channel_entry_save() must be an instance of EllisLab\ExpressionEngine\Model\Channel\ChannelEntry, instance of ExpressionEngine\Model\Channel\ChannelEntry given, called in ee/legacy/libraries/Extensions.php on line 203

user/addons/reading_time_pro/ext.reading_time_pro.php:74

Stack Trace: Please include when reporting this error

#0 ee/legacy/libraries/Extensions.php(203): Reading_time_pro_ext->after_channel_entry_save(Object(ExpressionEngine\Model\Channel\ChannelEntry), Array)
#1 ee/legacy/libraries/Extensions.php(108): EE_Extensions->call_class('Reading_time_pr…', 'after_channel_e…', Array, Array)
#2 [internal function]: EE_Extensions->call('after_channel_e…', Object(ExpressionEngine\Model\Channel\ChannelEntry), Array)
#3 ee/ExpressionEngine/Service/Model/Model.php(642): call_user_func_array(Array, Array)
#4 [internal function]: ExpressionEngine\Service\Model\Model->ExpressionEngine\Service\Model\{closure}('after_channel_e…', Object(ExpressionEngine\Model\Channel\ChannelEntry), Array)
#5 ee/ExpressionEngine/Service/Model/Model.php(588): call_user_func_array(Object(Closure), Array)
#6 [internal function]: ExpressionEngine\Service\Model\Model->ExpressionEngine\Service\Model\{closure}()
#7 ee/ExpressionEngine/Service/Event/Emitter.php(132): call_user_func_array(Object(Closure), Array)
#8 [internal function]: ExpressionEngine\Service\Event\Emitter->emit('afterSave')
#9 ee/ExpressionEngine/Library/Data/Entity.php(614): call_user_func_array(Array, Array)
#10 [internal function]: ExpressionEngine\Library\Data\Entity->emit('afterSave')
#11 ee/ExpressionEngine/Service/Model/Model.php(821): call_user_func_array('parent::emit', Array)
#12 ee/ExpressionEngine/Service/Model/Query/Insert.php(31): ExpressionEngine\Service\Model\Model->emit('afterSave')
#13 ee/ExpressionEngine/Service/Model/DataStore.php(275): ExpressionEngine\Service\Model\Query\Insert->run()
#14 ee/ExpressionEngine/Service/Model/DataStore.php(230): ExpressionEngine\Service\Model\DataStore->runQuery('Insert', Object(ExpressionEngine\Service\Model\Query\Builder))
#15 ee/ExpressionEngine/Service/Model/Query/Builder.php(79): ExpressionEngine\Service\Model\DataStore->insertQuery(Object(ExpressionEngine\Service\Model\Query\Builder))
#16 ee/ExpressionEngine/Service/Model/Model.php(349): ExpressionEngine\Service\Model\Query\Builder->insert()
#17 ee/ExpressionEngine/Model/Content/ContentModel.php(219): ExpressionEngine\Service\Model\Model->save()
#18 ee/ExpressionEngine/Controller/Publish/AbstractPublish.php(377): ExpressionEngine\Model\Content\ContentModel->save()
#19 ee/ExpressionEngine/Controller/Publish/Publish.php(300): ExpressionEngine\Controller\Publish\AbstractPublish->saveEntryAndRedirect(Object(ExpressionEngine\Model\Channel\ChannelEntry))
#20 [internal function]: ExpressionEngine\Controller\Publish\Publish->create('2')
#21 ee/ExpressionEngine/Core/Core.php(251): call_user_func_array(Array, Array)
#22 ee/ExpressionEngine/Core/Core.php(111): ExpressionEngine\Core\Core->runController(Array)
#23 ee/ExpressionEngine/Boot/boot.php(161): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))
#24 admin.php(153): require_once('...')
#24 admin.php(153): require_once('...')
#1

BoldMinded (Brian)

In the addon.setup.php file in Reading Time Pro, add this to the return array:

'aliases' => [
        'ExpressionEngine\Model\Channel\ChannelEntry',
    ],
#2

BoldMinded (Brian)

It should look like this

return [
    'author'      => 'BoldMinded',
    'author_url'  => 'https://boldminded.com/add-ons/reading-time-pro',
    'docs_url'    => 'http://docs.boldminded.com/reading-time-pro',
    'name'        => READING_TIME_PRO_NAME,
    'description' => '',
    'version'     => READING_TIME_PRO_VERSION,
    'namespace'   => 'BoldMinded\ReadingTimePro',
    'settings_exist' => true,
    'fieldtypes' => [
        READING_TIME_PRO_NAME_VAR => [
            'name' => READING_TIME_PRO_NAME,
            'compatibility' => 'text'
        ],
    ],

    'aliases' => [
        'ExpressionEngine\Model\Channel\ChannelEntry',
    ],
];
#3

Martijn Broeders

Thanks!! It works..

Login to reply