Skip to content

[mod.channel.php] implode(): Argument #1 ($array) must be of type array, string given #4783

Description

@MaxLazar

EE version: 7.5.10
Test env's: PHP 8.2 (DDEV and Amazon Linux 2023)

The page loads once, but then starts failing with an error. If I change the template or reset the cache, it loads once again.
All extensions were disabled for testing. Looks like some issues with cache.

Error

Warning
Undefined array key "entry_ids"
ee/ExpressionEngine/Addons/channel/mod.channel.php, line 2567

Severity: E_WARNING
TypeError Caught
implode(): Argument #1 ($array) must be of type array, string given
ee/ExpressionEngine/Addons/channel/mod.channel.php:2567

Stack Trace: Please include when reporting this error
#0 ee/ExpressionEngine/Addons/channel/mod.channel.php(2567): implode(',', NULL)
#1 ee/ExpressionEngine/Addons/channel/mod.channel.php(2446): Channel->getExtraData(Array)
#2 ee/ExpressionEngine/Addons/channel/mod.channel.php(264): Channel->parse_channel_entries()
#3 ee/legacy/libraries/Template.php(1840): Channel->entries()
#4 ee/legacy/libraries/Template.php(1515): EE_Template->process_tags()
#5 ee/legacy/libraries/Template.php(630): EE_Template->tags()
#6 ee/legacy/libraries/Template.php(248): EE_Template->parse('{!-- ra:0000000...', false, 1, false)
#7 ee/legacy/libraries/Template.php(178): EE_Template->fetch_and_parse('', '', false)
#8 ee/legacy/libraries/Core.php(811): EE_Template->run_template_engine('', '')
#9 ee/legacy/controllers/ee.php(53): EE_Core->generate_page()
#10 [internal function]: EE->index('united-states', 'tourist-visa-im...', '[current-state]')
#11 ee/ExpressionEngine/Core/Core.php(269): call_user_func_array(Array, Array)
#12 ee/ExpressionEngine/Core/Core.php(125): ExpressionEngine\Core\Core->runController(Array)
#13 ee/ExpressionEngine/Boot/boot.php(184): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))
#14 public_html/index.php(165): require_once('...')
#14 public_html/index.php(165): require_once('...')

tag code:

{exp:channel:entries disable="comments|categories|pagination|member_data"  dynamic="no" entry_id ="{entry_ids}"
  channel="visas" fixed_order="{entry_ids}"}

....


{/exp:channel:entrie}

Activity

  1. MaxLazar commented on Apr 8, 2025

    @MaxLazar
    Author

    Disabling sql_caching could be used as workaround.

    config['enable_sql_caching']          = 'n';
    

    I think the issue is here, that ee()->session->cache['channel']['entry_ids'] = $entries; is setup as part of build_sql_query function. But you don't run this function inside function entries() if $this->sql != '' (if sql string was cached) . Which cause an issue in function getExtraData which try to use ee()->session->cache['channel']['entry_ids'].

  2. added a commit that references this issue on Apr 12, 2025
    8fd402f
  3. added a commit that references this issue on May 1, 2025
    15eb634
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions