solved Unable to remove text field options in config of module.

Developer Networks
Developer Networks
@developer-networks
last year
566 posts
I hope this message finds you well. I am currently facing an issue while developing a module for Jamroom 7, and despite my efforts, I have been unable to resolve the issue.

In the config.php file, I initially created three different text input boxes under the myModuleName_config() function.
one for name, api_key, and api_token.

Heres the example:
function myBridgeConnect_config(){
    // API Key
    $_tmp = array(
        'name'     => 'api_key',
        'type'     => 'text',
        'default'  => '',
        'validate' => 'printable',
        'label'    => 'Bridge API Key',
        'help'     => 'Enter your API Key',
        'required' => true,
    );
    jrCore_register_setting('myBridgeConnect', $_tmp);

    return true;
}



These boxes all appeared in the module Global Config • general settings and functioned correctly, allowing me to save names, API keys and tokens to the module config file. However, as the API integration progressed, it became evident that only the token was required, prompting me to remove the two API key and name from the config.php file and the myBridgeConnect() function.

Regrettably, even after removing the code for these two text boxes, they persistently appear on the Admin Control Panel (ACP) Global Config • general settings tab for the module. I have diligently undertaken several troubleshooting steps to rectify this issue, including:

1. Clearing ALL browser cache and history.
2. Deleting the module item and associated keys from the database.
3. Integrity check including: Database Items, Language Strings, Form Sessions, PHP Opcache, File System Caches, Javascript Files, CSS Files, Sprite Icons, and All Template Files
4. Completely uninstalling the module, re-uploading the fixed new version, and reinstalling it.


Despite ALL these efforts, the unwanted text boxes remain visible on the ACP config tab, indicating that the removal is not taking effect as expected. At this point, I am inclined to believe that there may be a bug within Jamroom preventing the proper clearance of these unnecessary options from developers. Also, I am running the site in developer mode with no cache.

I kindly request your expertise and assistance in resolving this matter. Any guidance or insights you can provide to help me overcome this issue would be greatly appreciated.

Thank you for your time and support.

Best regards,
updated by @developer-networks: 04/05/24 04:27:03PM
Developer Networks
Developer Networks
@developer-networks
last year
566 posts
Heres an image showing the problem. This is also a dev site fresh install of Jamroom 7 with no other modules yet.
jamroom.png
jamroom.png  •  167KB


updated by @developer-networks: 12/15/23 02:34:59AM
michael
@michael
last year
7,746 posts
Delete the setting from the 'settings' table in the database.
Developer Networks
Developer Networks
@developer-networks
last year
566 posts
I completely removed the item and keys from the database in step 2 troubleshooting and I narrowed it down to a permissions issue on the new deployment. I wiped it and did a re install and got it back running with out issues so far. Its possible that I might experience and re create this issue again later as we design the module and add and remove the options.. thanks
updated by @developer-networks: 12/15/23 11:24:58PM
Developer Networks
Developer Networks
@developer-networks
last year
566 posts
Just a suggestion I found going over this issue:

When we delete a module from the Jamroom system inside the ACP we should be able to check the box to also have the module contents dropped from the datastore permanently.

Its not clearing out the old modules in the delete function. My system is saying the URL is still in use even after I delete a module and want another module to use that URL.

even if the delete function missed this part, Is this not a part of integrity check?
updated by @developer-networks: 12/16/23 02:39:03AM
brian
@brian
last year
10,148 posts
If you no longer need a setting, at the bottom of your _init() function you can delete it - i.e.

jrCore_delete_setting('myModule', 'my_unused_setting');



--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags