If the JLex comment dynamic module is used in com_tags_tag view, it gives this error:
0 - preg_match(): Argument #2 ($subject) must be of type string, array given
in line /components/com_jlexcomment/controller.php:174
The reason is because the com_tags_tag component returns an array of IDs instead of a single ID. This is because a menu item could be set to have multiple tags.
You could fix this by checking if $this->getParam("com_key") is an array. If it's an array, decide what to do. I see two options. Either:
- reset($this->getParam("com_key")) so it only gets the first ID. This is probably fine in most cases, as in 99% of the time, it's only one tag being displayed in the view.
- or concatenate a string of IDs eg. if tags displayed are tag ID:5 and tag ID:9, $this->getParam("com_key") could become "5-9"
0 - preg_match(): Argument #2 ($subject) must be of type string, array given
in line /components/com_jlexcomment/controller.php:174
The reason is because the com_tags_tag component returns an array of IDs instead of a single ID. This is because a menu item could be set to have multiple tags.
You could fix this by checking if $this->getParam("com_key") is an array. If it's an array, decide what to do. I see two options. Either:
- reset($this->getParam("com_key")) so it only gets the first ID. This is probably fine in most cases, as in 99% of the time, it's only one tag being displayed in the view.
- or concatenate a string of IDs eg. if tags displayed are tag ID:5 and tag ID:9, $this->getParam("com_key") could become "5-9"