Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: breaking section in module.xml #155

Open
vsc55 opened this issue Aug 31, 2024 · 3 comments
Open

[bug]: breaking section in module.xml #155

vsc55 opened this issue Aug 31, 2024 · 3 comments
Labels

Comments

@vsc55
Copy link
Contributor

vsc55 commented Aug 31, 2024

FreePBX Version

FreePBX 17

Issue Description

I am adding a breaking section to the modele.xml to be able to add a conflict condition with another module but the following error is generated.
This would be an example of the modification:

<module>
	<rawname>module</rawname>
	.....
	<breaking>
		<module>
			<rawname>cdr</rawname>
	        	<type>conflict</type>
		</module>
	</breaking>
	...
</module>

I tested it by enabling and disabling the module to which I added the previous code in the module.xml file, so the exception occurs in the 'enable' section. However, the same code is in install/uninstall/etc., so I assume it will give the same error.

I tested this on FreePBX 17, but I understand that the same happens in version 16.

Operating Environment

Whoops\Exception\ErrorException thrown with message "Undefined array key "OSS PBX End Point Manager""

Stacktrace:
#2 Whoops\Exception\ErrorException in /usr/src/freepbx/framework/amp_conf/htdocs/admin/page.modules.php:645
#1 Whoops\Run:handleError in /usr/src/freepbx/framework/amp_conf/htdocs/admin/page.modules.php:645
#0 include in /usr/src/freepbx/framework/amp_conf/htdocs/admin/config.php:481

Relevant log output

I have made some bugs for $conflicterrors and $module.
These are the data.

$conflicterrors = $FreePBX->Modules->checkConflicts($modules[$module]);

$module => endpointman
$conflicterrors =>

 Array
(
    [breaking] => 1
    [issues] => Array
        (
            [cdr] => Array
                (
                    [0] => The currently installed module CDR Reports [cdr] conflicts with OSS PBX End Point Manager [endpointman]. Having both installed may cause issues with the functionality of your system.
                )

        )

    [replacements] => Array
        (
        )

)


If more modules are added in the brocket section, $conflicterrors is null.
@vsc55 vsc55 added bug triage Triage labels Aug 31, 2024
vsc55 added a commit to vsc55/freepbx_framework that referenced this issue Aug 31, 2024
…on of the module.xml file. FreePBX#155

Fix error on the views page where the data collected by checkConflicts() was not accessed correctly.  FreePBX#155
@vsc55
Copy link
Contributor Author

vsc55 commented Aug 31, 2024

By the way, there is no information regarding this option in the wiki documentation.
https://sangomakb.atlassian.net/wiki/spaces/FP/pages/10289830/module.xml

Adding something like this would be nice.

<module>
    <rawname>reset</rawname>
    <name>Reset Module</name>
    <breaking>
        <module>
            <rawname>target_module_1</rawname>
            <type>conflict</type>
            <version>1.0.0</version>
            <errormessage>The module RESET conflicts with TARGET_MODULE_1. Having both installed may cause issues with the functionality of your system.</errormessage>
        </module>
        <module>
            <rawname>target_module_2</rawname>
            <type>conflict</type>
            <version>2.0.0</version>
            <errormessage>The module RESET conflicts with TARGET_MODULE_2. Having both installed may cause issues with the functionality of your system.</errormessage>
        </module>
        <module>
            <rawname>target_module_3</rawname>
            <type>conflict</type>
            <!-- No version or errormessage provided -->
        </module>
    </breaking>
</module>

@kguptasangoma
Copy link
Member

kguptasangoma commented Sep 2, 2024

We have callback logic to check the conflict module during the install time so why you like to add into the module.xml ?

Ref - https://github.com/FreePBX/ucp/blob/release/16.0/install.inc.php#L8

@vsc55
Copy link
Contributor Author

vsc55 commented Sep 2, 2024

Hi @kguptasangoma,
Yes, I already saw that logic, but it seemed cleaner to me to have it in the module.xml just like the depends and requirements.
I also saw that the breaking option already existed, so I decided to create a PR to make this option operational.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants