Skip to content

Feedback - Issue when installing "Setup 2024 version": Fatal is thrown #2495

@freibergergarcia

Description

@freibergergarcia

Type of feedback

//dev

Description

I'm seeing a fatal error while running yarn run create:

Fatal error: Uncaught Error: Call to undefined function WPOrg_Learn\Sensei\get_my_courses_page_url() in /var/www/html/wp-content/themes/pub/wporg-learn-2024/functions.php:113
Stack trace:
#0 /var/www/html/wp-includes/class-wp-hook.php(324): WordPressdotorg\Theme\Learn_2024\add_site_navigation_menus(Array)
#1 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
#2 /var/www/html/wp-content/mu-plugins/wporg-mu-plugins/mu-plugins/blocks/navigation/index.php(29): apply_filters('wporg_block_nav...', Array)
#3 /var/www/html/wp-includes/class-wp-hook.php(324): WordPressdotorg\MU_Plugins\Navigation_Block\init('')
#4 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#5 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#6 /var/www/html/wp-settings.php(700): do_action('init')
#7 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1336): require('/var/www/html/w...')
#8 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1 in /var/www/html/wp-content/themes/pub/wporg-learn-2024/functions.php on line 113

Looks like the wporg-learn plugin isn't active yet when the theme is activated.

The fatal occurs on https://github.com/WordPress/Learn/blob/trunk/wp-content/themes/pub/wporg-learn-2024/functions.php#L113C15-L113C38

Proposed solution

I was able to make it work by adding wporg-learn at the end of:
https://github.com/WordPress/Learn/blob/trunk/bin/index.sh#L18

Step-by-step reproduction instructions (optional)

Make sure to run yarn run wp-env destroy in case your installation has the plugin already active.

Follow the steps under "Setup 2024 version":

yarn
yarn run create

Screenshots or screen recording (optional)

Screenshot 2024-06-03 at 10 43 04 PM

Other information (optional)

Replicated on MacOS, with Node 18 and 20

Metadata

Metadata

Labels

Dev[Component] EnvironmentWebsite development issues related to Learn's local environment, or needs Meta team involvement.[Type] BugSomething isn't working on the Learn website.

Type

No type
No fields configured for issues without a type.

Projects

Status
✅ Done
Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions