Addon Dependencies Being Ignored?


I'm porting some of my CS 2.x addons to CS 4. However, the “dependencies” seem to be being ignored. I'll illustrate with a barebones example of an “addon.xml” file- and nothing else- in the folder “C:\sites\cs4\htdocs\app\addons\dd_ERASEME”:-








One two three four

Installation should fail since “dd_DOES_NOT_EXIST_ADDON” doesn't exist… but it goes ahead fine! Am I misunderstanding something here?

I tried debugging the code, and it seems that the dependencies element is being parsed and passed to the addons dependencies handlers, but I didn't want to spend forever debugging the whole thing (especially if it's not a bug!!)

Any help appreciated, thank you.

  • Smich

Hello [color=#282828][font=arial, verdana, tahoma, sans-serif]Smich,[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]CS-Cart doesn't work as you've written by default. It is neccessary to specify id of the existing add-ons in the “dependencies” section because CS-Cart will ignore id of add-ons that don't exist.[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]Sincerely yours,[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]CS-Market.[/font][/color]


Thank you for your reply.

When you say “existing add-ons”, I assume you mean ones that already exist in (i.e. have been copied into) the app/addons directory? (*)

If correct, this does seem rather unhelpful behaviour, as the most obvious case is where a user has entirely neglected to get a required add-on, and the “dependencies” check wouldn't catch this…?!

Strange… thanks for the informative reply anyway!

  • Smich

    (*) Otherwise, how would it know whether the add-on referred to “exists” or not? Unless they're registered with a central database?

Additional; yes, as expected it did complain when the real “parent” plugin was in the addons subdirectory, but not actually installed.

As I said though, it’s very strange (and pointlessly unhelpful) that the dependency-checking doesn’t handle the case of the plugin being entirely missing altogether… unless there’s a good reason for this? :confused:

  • Smich

Dependencies are implemented to support cs-cart addons. I.e. only those distributed and hence they exist. The original case of having a dependency on an addon that has not been loaded is what's needed. But like most things, it is only internal needs that are considered during development. Addon developers are an after-thought at best and there certainly is never any communication in advance to develop the real requirements.

I suggested that the dependencies tag should be a function name accessible from the schemas/settings/dependencies.php file so an addon could determine how to handle their own dependencies. But of course, that request was ignored (note the request was made in V2).

But you can use the 'functions' tag to handle your own dependencies and simply ignore the dependencies tag.

Thanks for the info, I'll look into that “functions” tag…