CORE-POS / IS4C

Cooperative Operational Retail Environment
http://www.core-pos.com
GNU General Public License v2.0
63 stars 44 forks source link

Notifiers in AutoLoader #1172

Closed flathat closed 1 year ago

flathat commented 1 year ago

I've enabled the CashDrop plugin that is in the main CORE repo (not the separate one). I expected CashDropNotifier which extends Notifier to be auto-loaded but it was not; the Notifier does not appear when the conditions for it are met.

In CashDropPreParser I've added:
if (!class_exists("AutoLoader")) include_once(realpath(dirname(__FILE__).'/../../lib/AutoLoader.php'));

If in CashDropPreParser->check() I look for CashDropNotifier in the array returned by CoreLocal::get('Notifiers') it is absent. If I add it to the Notifiers array in CoreLocal then it becomes usable in the plugin.

Should AutoLoader be loading it? If so, what is needed for that to happen?

I found that TermStateNotifier from the Paycards plugin is in the Notifiers array at the the point when CashDropNotifier is not even though the Paycards plugin isn't enabled.

gohanman commented 1 year ago

Notifiers need to be configured under the "Extra" tab.

https://github.com/CORE-POS/IS4C/blob/master/pos/is4c-nf/install/extra_config.php#L300-L316