Skip to content

Argument #1 ($string) must be of type string, array given #186

@matthewhilton

Description

@matthewhilton

Got a site failing with this error:

Adhoc task failed: tool_crawler\task\adhoc_crawl_task,rawurlencode(): Argument #1 ($string) must be of type string, array given
Backtrace:
line 522 of /lib/weblib.php: call to rawurlencode()
line 618 of /lib/weblib.php: call to moodle_url->get_query_string()
line 338 of /admin/tool/crawler/classes/robot/crawler.php: call to moodle_url->raw_out()
line 897 of /admin/tool/crawler/classes/robot/crawler.php: call to tool_crawler\robot\crawler->mark_for_crawl()
line 867 of /admin/tool/crawler/classes/robot/crawler.php: call to tool_crawler\robot\crawler->link_from_node_to_url()
line 632 of /admin/tool/crawler/classes/robot/crawler.php: call to tool_crawler\robot\crawler->parse_html()
line 578 of /admin/tool/crawler/classes/robot/crawler.php: call to tool_crawler\robot\crawler->crawl()
line 81 of /admin/tool/crawler/lib.php: call to tool_crawler\robot\crawler->process_queue()
line 54 of /admin/tool/crawler/classes/task/adhoc_crawl_task.php: call to tool_crawler_crawl()
line 413 of /lib/cronlib.php: call to tool_crawler\task\adhoc_crawl_task->execute()
line 252 of /lib/cronlib.php: call to cron_run_inner_adhoc_task()
line 272 of /lib/cronlib.php: call to cron_run_adhoc_task()
line 155 of /admin/cli/adhoc_task.php: call to cron_run_failed_adhoc_tasks()

It seems like it is parsing a URL here

$murl = new \moodle_url($url);
and interpreting some of the url params as arrays

Looking into the code a bit more, it does detect if the value is_array ; this makes me wonder if it is a double layer array ?

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