How to prevent an conflict between components?

Rafael Amorim Posted in Component Development 3 months ago

It's possible on the ossn_com.xml of a component set another one required. And with this option, this component cannot be enabled.

Question is: Is there any tag on xml to set an package in conflict with other? If not exists, is there some component with this type of code to inspire me?

Replies
Breton Rafael Amorim Replied 2 months ago

Thanks, @Arsalan and @Michael. Currently, I'm working a lot these days on a few projects and can't have the time to sit and reply properly to all messages.

Regards!

ph Roman Jay Almaza Replied 3 months ago

Thank you Arsalan Shah, I tried using this code and I have no problem running this.

Indonesian Arsalan Shah Replied 3 months ago

Yes the Anonymous users component xml is exactly if you wanted something is disable or not installed

<requires>
    <type>ossn_component</type>
    <name>DisplayUsername</name>
    <comparator>disabled</comparator>
</requires>  

.

German Michael Z├╝lsdorff Replied 3 months ago

Hmm ... from what I understand is that Rafael was looking for right the opposite: something to be NOT installed or disabled because it would conflict otherwise.
One example is
https://www.opensource-socialnetwork.org/component/view/4029/anonymous-registration
more can be found in GreenByGreen

Indonesian Arsalan Shah Replied 3 months ago

See blog component

<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://www.opensource-socialnetwork.org/v/3.0">
    <name>Blogs</name>
    <id>Blog</id>
    <author>Core Team</author>
    <description>Allow members to add blogs to their profile page.</description>
    <license>Open Source Social Network License (OSSN LICENSE)</license>
    <author_url>https://www.openteknik.com/</author_url>
    <license_url>http://www.opensource-socialnetwork.org/licence/</license_url>
    <version>6.5</version>
    <requires>
        <type>ossn_version</type>
        <version>6.0</version>
    </requires>
    <requires>
        <type>ossn_component</type>
        <name>OssnProfile</name>
        <version>6.0</version>
    </requires>
    <requires>
        <type>ossn_component</type>
        <name>TextareaSupport</name>
        <version>6.7</version>
    </requires>
</component>

.