Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
matthewhilton opened this issue Nov 12, 2024 · 1 comment
Open

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

matthewhilton opened this issue Nov 12, 2024 · 1 comment

Comments

@matthewhilton
Copy link
Contributor

matthewhilton commented Nov 12, 2024

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 ?

@matthewhilton
Copy link
Contributor Author

Looks to be more of a core bug, where multi level array parameters with moodle_url are not supported properly - see https://tracker.moodle.org/browse/MDL-77293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant