Skip to content

Add scan-classes mixin when adding Api4 classes#411

Merged
totten merged 1 commit intototten:masterfrom
colemanw:addScanClasses
Sep 26, 2025
Merged

Add scan-classes mixin when adding Api4 classes#411
totten merged 1 commit intototten:masterfrom
colemanw:addScanClasses

Conversation

@colemanw
Copy link
Copy Markdown
Contributor

@colemanw colemanw commented Sep 24, 2025

This used to be a soft-requirement but is now strongly encouraged.
See civicrm/civicrm-core#33371
@colemanw
Copy link
Copy Markdown
Contributor Author

FYI @ufundo

@colemanw
Copy link
Copy Markdown
Contributor Author

@totten test failure appears unrelated to this pr:

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.0". You are running 7.4.29. in /home/homer/buildkit/build/warmup/web/sites/all/modules/civicrm/vendor/composer/platform_check.php on line 24

@totten
Copy link
Copy Markdown
Owner

totten commented Sep 25, 2025

@colemanw I think that notice should be fixed, but I think it's a red-herring. AFAICS, it only appeared once. And it's talking about the "cache warmup" which prepopulates some stuff in composer's cache. (But if warmup fails... then composer will just download the necessary files on-demand.)

Looking at more failures, the common theme (near the end) is:

Enabling extension "org.example.civixsnapshot"

In MySearch.php line 7:
                                                         
  Class "CRM_Contact_Form_Search_Custom_Base" not found  
                                                         

ext:enable [-r|--refresh] [--ignore-missing] [--] [<key-or-name>...]

I think this reveals a latent problem:

  • The make-snapshots job tries several scenarios for generating extensions... including the kitchensink scenario. That calls every generator, including generate:search.
  • If you call generate:search, then you make a class which extends CRM_Contact_Form_Search_Custom_Base and therefore (in modern times) depends on legacycustomsearches. But the info.xml doesn't declare the dependency.
  • When you enable class-scanning, then it will try to read that class-file during installations. But the class cannot be read because legacycustomsearches is disabled.

I'll throw up a PR to see if it's easy to drop generate:search. (If it's hard to remove, then we can also fix it -- with a silver-lining of having an example of auto-updating the <requires> directive.)

@totten
Copy link
Copy Markdown
Owner

totten commented Sep 25, 2025

civibot, test this please

@totten totten merged commit 4a79672 into totten:master Sep 26, 2025
1 check passed
@colemanw colemanw deleted the addScanClasses branch September 26, 2025 20:15
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.

2 participants