Autoload has a known issue where classes are not found when a module is first enabled. A work around is to clear the cache to rebuild the cache.

I have marked the issue as major as it:

  • Breaks simple tests.
  • Causes errors like Fatal error: Class 'Notifications_Subscription' not found to appear when a module is first enabled.

The issue is known in the autoload issue queue #826050: Reload cache on missing class.

The issue above recommends project implement their own fix in the form of autoload_flush_caches() from their hook_enable().

This fix may help the following threads:

This issue also affects the dependency Messaging API see it's own patch here #1351748: Autoload classes not found on enable.

Comments

JoeMcGuire’s picture

Status: Active » Needs review
StatusFileSize
new1.73 KB

Attached patch adds hook_enable() with autoload_flush_caches() too notifications and notifications_custom which are the two affected modules which include hook_autoload_info().

This allows you to run the tests and stops sites generating class not found when the module is first enabled.

You will need to test this patch in hand with the patch for the messaging API dependancy.
#1351748: Autoload classes not found on enable

JoeMcGuire’s picture

Improved patch attached which removes an old hook_enable() from notifications.module in favour of a new on in notifications.install.

JoeMcGuire’s picture

Further improved patch removing another old hook_enable() from notifications_custom.module.

ryan_courtnage’s picture

Status: Needs review » Reviewed & tested by the community

Thans @JoeMcGuire, this patch does indeed resolve #884916: Class Notifications_Subscriptions not found

danepowell’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Removed an issue from the list of related - it shouldn't have been included.