osDXP / osdxp-dashboard

An Augmentation of WordPress, creating a task-oriented Digital Experience Platform environment.
https://osdxp.org
Other
21 stars 2 forks source link

Switch to PSR-4 autoloading from classmap #18

Open XedinUnknown opened 4 years ago

XedinUnknown commented 4 years ago

The Symptom

After activating the plugin and reloading the page, I receive the following message:

Fatal error:  Uncaught Error: Class 'OSDXP_Dashboard\OsdxpModuleUpdateChecker' not found in includes/utils.php:31
  #0 /var/www/html/wp-includes/class-wp-hook.php(286): OSDXP_Dashboard\hook_update_check('')
  #1 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
  #2 /var/www/html/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
  #3 /var/www/html/wp-settings.php(450): do_action('init')
  #4 /var/www/html/wp-config.php(88): require_once('/var/www/html/w...')
  #5 /var/www/html/wp-load.php(37): require_once('/var/www/html/w...')
  #6 /var/www/html/wp-admin/admin.php(31): require_once('/var/www/html/w...')
  #7 /var/www/html/wp-admin/network/admin.php(13): require_once('/var/www/html/w...')
  #8 /var/www/html/wp-admin/network/plugins.php(11): require_once('/var/www/html/w...')
  #9 {main}
  thrown in includes/utils.php on line 31

Possible Cause

The class files are not being loaded. The includes folder is listed as a PSR-4 root, but none of the classes in this project follow PSR-4.

Suggested Solution

Remarks

This problem does not seem to manifest when installing the plugin from dist manually, or from source via cloning. It manifests when this package is a dependency of another package. While this is issue is indeed an issue in its own right, it currently manifests due to #16.

al-esc commented 4 years ago

hotfixed in 1.0.1, keeping this open since we need to switch to psr-4 rather than classmap

XedinUnknown commented 4 years ago

Oh, that would be wonderful! Let me know if there's something I can do to help in general.