CORE-POS / IS4C

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

Not finding ReceiptMessages #1161

Closed flathat closed 1 year ago

flathat commented 1 year ago

I need some help understanding how ReceiptLib finds plugin classes that extend ReceiptMessage. I have one that does that:

class FoodBucksBalanceFooter extends ReceiptMessage

but it's message isn't displayed even when the default select_condition() (always "1") is used and the message() is just a dummy. Everything else in the plugin works.

I tried enabling the MarketBucks plugin which has something similar and jiggering it to display but it does not.

I tried putting my ReceiptMessage module in lib/ReceiptBuilding/Messages and modeling the namespace and use statements on EbtReceiptMessage.php, which is found and executed, but it is not found.

namespace COREPOS\pos\lib\ReceiptBuilding\Messages;
use COREPOS\pos\lib\Database;
use COREPOS\pos\lib\ReceiptLib;
use \CoreLocal;

I tried adding the version of my module in .../Messages to the $msgMods array in ReceiptLib but that did not help. Removing GCBalanceReceiptMessage did not prevent it from being processed.

I expected these modules to be in CoreLocal::get('ReceiptMessageMods') when ReceiptLib::messageMods() uses it but they are not. The only two that are are EbtReceiptMessage and GCBalanceReceiptMessage.

I've disabled and re-enabled the plugin. I sign out of the lane and Ctrl-Shift-R reload between each test. There are no errors being logged.

Any suggestion as to what is missing?

flathat commented 1 year ago

What is missing is that the ReceiptMessage in the plugin needs to be added to the list of Message Modules in Install > Receipt.

class FoodBucksBalanceFooter extends ReceiptMessage alone does not get the module executed, only into the list of those available for execution that must then be chosen.