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

Fix getComponentInstallDirectory plugintypes retrieval issue. #337

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

kabalin
Copy link
Member

@kabalin kabalin commented Jan 31, 2025

fetch_plugintypes return signature was changed at MDL-79843.

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.26%. Comparing base (06df50c) to head (a10b6df).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/Bridge/Moodle.php 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #337      +/-   ##
============================================
- Coverage     88.30%   88.26%   -0.04%     
- Complexity      760      761       +1     
============================================
  Files            77       77              
  Lines          2334     2335       +1     
============================================
  Hits           2061     2061              
- Misses          273      274       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PhilippImhof
Copy link

PhilippImhof commented Jan 31, 2025

This will Fix #338; you were a split second faster than me...

(I thought that the comment could be useful because it would link the issue to this PR and close it when merging. Apparently that only works if done by someone with the necessary permissions in the repo.)

Copy link
Member

@paulholden paulholden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Ruslan & Philipp 👍

fetch_plugintypes return signature was changed at MDL-79843.

Fixes moodlehq#338
@kabalin kabalin linked an issue Jan 31, 2025 that may be closed by this pull request
@kabalin kabalin merged commit d9ebaf9 into moodlehq:main Jan 31, 2025
24 of 27 checks passed
@kabalin kabalin deleted the fix-plugininfo branch January 31, 2025 13:05
@andrewnicols
Copy link
Contributor

Hi peeps,

I'm just wondering what the ratinoale is for not using \core\component::get_component_directory($component);?

I know that the comment says it's beacuse you don't want to use the static cache:

// Must use reflection to avoid using static cache.

But fetch_plugintypes() uses a static cache anyway.

The original reason for this is described in the commit message of 6138af1

Avoid using static cache in core_component

When installing multiple plugins, core_component's
static cache becomes stale. This is bad when installing
a parent plugin, then a sub-plugin. Use reflection
to gain access to the un-cached method we need.

If this is the case, then we should already be calling \core\component::reset() after placing the new plugin anyway.

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

Successfully merging this pull request may close these issues.

Installing moodle-plugin-ci failing for Moodle main branch
4 participants