Inverted dependencies in some modules on 5.0.x

1 view
Skip to first unread message

Alexander Obuhovich

unread,
Aug 22, 2012, 2:53:06 PM8/22/12
to Bugs In-Portal
In-Portal is a modular system and it allows additional features to be added to it via installing new modules.
Dependencies (if any exist) of each module must be checked by module itself and not by module it relies to be installed on a system.

Here are few places where we have problems with that:


1. When only In-Commerce installed, then following warnings are displayed on unit config cache rebuild:
  • Prefix lst doesn't exist when trying to hook from p:OnSaveVirtualProduct in ...\core\kernel\managers\hook_manager.php on line 97
  • Prefix lst doesn't exist when trying to hook from p:OnDeleteListingType in ...\core\kernel\managers\hook_manager.php on line 97
  • Prefix lst doesn't exist when trying to hook from p:OnModifyPaidListingConfig in ...\core\kernel\managers\hook_manager.php on line 97
This happens because In-Commerce module, when installed tries to access In-Link module, which might not be installed at all and do something with it.
To fix this we first must check if In-Link module is installed and only then connect to it.


2. When In-Portal is installed without any other modules, then following warnings are displayed on unit config cache rebuild:
  • Prefix p doesn't exist when trying to hook from rel:OnDeleteForeignRelations in w:\d\in-portal.52x\core\kernel\managers\hook_manager.php on line 97
This happens because In-Portal, due it's historically close connection to In-Commerce module (where developed together), trying to connect to In-Commerce module even if it's not installed.
In this case it's pretty easy to invert dependency and In-Commerce module (when installed) should connect to In-Portal and not otherwise.


As you might have noticed both errors comes from same 97th line of hook_manager.php. In that line hook definition validation happens (e.g. does all events and units mentioned in a hook really exists on a system).
If something goes wrong at this point, then this could be developer typo error or other error. In any case we let developer know.
Since in warning messages above we check dependencies at wrong module we can't really guess if mentioned unit config prefix is a typo error or absolutely valid unit from not installed module.

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry A.

unread,
Oct 19, 2012, 12:13:09 AM10/19/12
to in-port...@googlegroups.com
Hi Alex,


Let's put a plan on how this should be fixed and then we can select an appropriate release for it.


DA
Reply all
Reply to author
Forward
0 new messages