New Module Created, then Put on Front Page Dashlet. Error in Coding causing issues. <--A Bug?!?!

Hello,

Before anything, this is my system info.
System: Linux usm26.siteground.biz 3.12.18-clouder0 #20 SMP Mon Feb 26 12:15:53 EET 2018 x86_64
MySql: 5.5.32
PHP Version 7.1.17
SuiteCRM Version: 7.8.5
Sugar Version 6.5.24 (Build 509)
I do have complete access to this install.

I created a new module for my SuiteCRM in which I was going to enter only my vendor’s information. I used a “company” template to create my module. I named the new module “Vendor_Details”. Afterward, I deployed the module and it seemed like all went well. I even added a record in the Vendor_Details module. So I decided that I wanted to add this Vendor_Details module onto the Home page. So I pressed the Add Dashlet and selected the new module. This action has now caused my home page to have errors. :sick:

The front home page now says “Parse error: syntax error, unexpected ‘$module_name’ (T_VARIABLE), expecting identifier (T_STRING) in /home/” I am keeping the path secret. So, I go to the file that has the error which is the “Ven_Vendor_DetailsDashlet.php” file and I do notice that my Codiad program mentions that there is an error with my code. It mentions that it is a “Syntax error, unexpected ‘<’ , expecting T_STRING” This code was produced when I created the new module and I did not edit it. The error was present when I first viewed this file.

I am very novice, at this point, in php coding. So any assistance will be appreciated.
Picture of Code Error:
https://www.healthcorefitness.com/wp-content/uploads/Vendor_Details.png

Here is the code:

class <module_name > Dashlet extends DashletGeneric {
    function __construct($id, $def = null)
    {
        global $current_user, $app_strings;
        require('modules/Ven_Vendor_Details/metadata/dashletviewdefs.php');

        parent::__construct($id, $def);

        if (empty($def['title'])) {
            $this->title = translate('LBL_HOMEPAGE_TITLE', 'Ven_Vendor_Details');
        }

        $this->searchFields = $dashletData['Ven_Vendor_DetailsDashlet']['searchFields'];
        $this->columns = $dashletData['Ven_Vendor_DetailsDashlet']['columns'];

        $this->seedBean = new Ven_Vendor_Details();        
    }
}

It seems Studio is messing something up when writing that file…

But the first thing I would try is an upgrade to the latest 7.8.20, this bug can be corrected a long time ago…

Hello Pgr,

I have upgraded the SuiteCRM to the Version 7.10.7 Sugar Version 6.5.25 (Build 344). It sure looks a lot nicer. However, my issue is still showing up. I redeployed the module and the error still persists. I ran the Quick Repair and Rebuild, Rebuild Relationships and the Rebuild SuiteCRM Dashlets. None of these activities repaired the front page.

Any idea on what I can do to repair this issue?

I might have to uninstall the module and retry again. However, this may lead me to the same issue.

Yes, recreating the module might help. If the bug is at the moment the module is created, then to retry it we would have to start over, I guess.

Hello,

I have already recreated the module and the problem still persists.
I do think I have to start over. Is there a good thread where I can see on how I can uninstall this module?

I want to uninstall the module and start over fresh.

Sorry, I don’t know of any place explaining how to uninstall a module.

Don’t you have any errors on suitecrm.log or php_errors.log at the time the module was created?

If this proves to be a bug, then you should write down the exact steps to reproduce it and report it on GitHub.

Hello,

I did not have any php_error.log for my SuiteCRM installation. Should I configure and/or set this up on my SuiteCRM installation.

I checked the SuiteCRM.log.
These are the only two errors that may be of any significance.


Mon Jun 18 04:34:32 2018 [45913][1][FATAL] project_resource for projects_users_resources failed to load

Mon Jun 18 04:34:32 2018 [45913][1][FATAL] am_projecttemplates_resources for am_projecttemplates_users_resources failed to load

Mon Jun 18 04:34:32 2018 [45913][1][FATAL] project_resource for projects_contacts_resources failed to load

Mon Jun 18 04:34:32 2018 [45913][1][FATAL] am_projecttemplates_resources for am_projecttemplates_contacts_resources failed to load

Mon Jun 18 04:34:32 2018 [45913][1][FATAL] project_resource for projects_users_resources failed to load

Mon Jun 18 04:34:32 2018 [45913][1][FATAL] am_projecttemplates_resources for am_projecttemplates_users_resources failed to load

Mon Jun 18 04:34:32 2018 [45913][1][FATAL] assigned_user_link for tracker_user_id failed to load

Mon Jun 18 04:34:32 2018 [45913][1][FATAL] Class Connectors does not exist, unable to rename.
Mon Jun 18 04:34:32 2018 [45913][1][FATAL] Class Version does not exist, unable to rename.
Mon Jun 18 04:34:32 2018 [45913][1][FATAL] Class CustomFields does not exist, unable to rename.
Mon Jun 18 04:34:32 2018 [45913][1][FATAL] Class Audit does not exist, unable to rename.
Mon Jun 18 04:34:32 2018 [45913][1][FATAL] project_resource for projects_users_resources failed to load

Mon Jun 18 04:34:32 2018 [45913][1][FATAL] am_projecttemplates_resources for am_projecttemplates_users_resources failed to load

Mon Jun 18 04:34:32 2018 [45913][1][FATAL] aos_products_purchases for aos_products_purchases failed to load

and this must of occured when I upgraded my SuiteCRM installation.

Tue Jun 19 04:23:31 2018 [8010][1][FATAL] Mysqli_query failed.
Tue Jun 19 04:23:31 2018 [8010][1][FATAL]  Query Failed: SELECT 
                    ea.email_address,
                    ea.email_address_caps,
                    ea.invalid_email,
                    ea.opt_out,
                    ea.confirm_opt_in,
                    ea.date_created,
                    ea.date_modified,
                    ear.id,
                    ear.email_address_id,
                    ear.bean_id,
                    ear.bean_module,
                    ear.primary_address,
                    ear.reply_to_address,
                    ear.deleted
                FROM email_addresses ea LEFT JOIN email_addr_bean_rel ear ON ea.id = ear.email_address_id
                WHERE 
                    ear.bean_module = 'Users'
                    AND ear.bean_id = '1'
                    AND ear.deleted = 0
                ORDER BY ear.reply_to_address, ear.primary_address DESC: MySQL error 1054: Unknown column 'ea.confirm_opt_in' in 'field list'
Tue Jun 19 04:23:37 2018 [8275][1][FATAL] Mysqli_query failed.
Tue Jun 19 04:23:37 2018 [8275][1][FATAL]  Query Failed: SELECT 
                    ea.email_address,
                    ea.email_address_caps,
                    ea.invalid_email,
                    ea.opt_out,
                    ea.confirm_opt_in,
                    ea.date_created,
                    ea.date_modified,
                    ear.id,
                    ear.email_address_id,
                    ear.bean_id,
                    ear.bean_module,
                    ear.primary_address,
                    ear.reply_to_address,
                    ear.deleted
                FROM email_addresses ea LEFT JOIN email_addr_bean_rel ear ON ea.id = ear.email_address_id
                WHERE 
                    ear.bean_module = 'Users'
                    AND ear.bean_id = '1'
                    AND ear.deleted = 0
                ORDER BY ear.reply_to_address, ear.primary_address DESC: MySQL error 1054: Unknown column 'ea.confirm_opt_in' in 'field list'
Tue Jun 19 04:23:37 2018 [8286][1][FATAL] Mysqli_query failed.
Tue Jun 19 04:23:37 2018 [8286][1][FATAL]  Query Failed: SELECT 
                    ea.email_address,
                    ea.email_address_caps,
                    ea.invalid_email,
                    ea.opt_out,
                    ea.confirm_opt_in,
                    ea.date_created,
                    ea.date_modified,
                    ear.id,
                    ear.email_address_id,
                    ear.bean_id,
                    ear.bean_module,
                    ear.primary_address,
                    ear.reply_to_address,
                    ear.deleted
                FROM email_addresses ea LEFT JOIN email_addr_bean_rel ear ON ea.id = ear.email_address_id
                WHERE 
                    ear.bean_module = 'Users'
                    AND ear.bean_id = '1'
                    AND ear.deleted = 0
                ORDER BY ear.reply_to_address, ear.primary_address DESC: MySQL error 1054: Unknown column 'ea.confirm_opt_in' in 'field list'
Tue Jun 19 04:23:43 2018 [8481][1][FATAL] Mysqli_query failed.
Tue Jun 19 04:23:43 2018 [8481][1][FATAL]  Query Failed: SELECT 
                    ea.email_address,
                    ea.email_address_caps,
                    ea.invalid_email,
                    ea.opt_out,
                    ea.confirm_opt_in,
                    ea.date_created,
                    ea.date_modified,
                    ear.id,
                    ear.email_address_id,
                    ear.bean_id,
                    ear.bean_module,
                    ear.primary_address,
                    ear.reply_to_address,
                    ear.deleted
                FROM email_addresses ea LEFT JOIN email_addr_bean_rel ear ON ea.id = ear.email_address_id
                WHERE 
                    ear.bean_module = 'Users'
                    AND ear.bean_id = '1'
                    AND ear.deleted = 0
                ORDER BY ear.reply_to_address, ear.primary_address DESC: MySQL error 1054: Unknown column 'ea.confirm_opt_in' in 'field list'
Tue Jun 19 04:23:46 2018 [8641][1][FATAL] Mysqli_query failed.
Tue Jun 19 04:23:46 2018 [8641][1][FATAL]  Query Failed: SELECT 
                    ea.email_address,
                    ea.email_address_caps,
                    ea.invalid_email,
                    ea.opt_out,
                    ea.confirm_opt_in,
                    ea.date_created,
                    ea.date_modified,
                    ear.id,
                    ear.email_address_id,
                    ear.bean_id,
                    ear.bean_module,
                    ear.primary_address,
                    ear.reply_to_address,
                    ear.deleted
                FROM email_addresses ea LEFT JOIN email_addr_bean_rel ear ON ea.id = ear.email_address_id
                WHERE 
                    ear.bean_module = 'Users'
                    AND ear.bean_id = '1'
                    AND ear.deleted = 0
                ORDER BY ear.reply_to_address, ear.primary_address DESC: MySQL error 1054: Unknown column 'ea.confirm_opt_in' in 'field list'
Tue Jun 19 04:24:03 2018 [10309][1][FATAL] Mysqli_query failed.
Tue Jun 19 04:24:03 2018 [10309][1][FATAL]  Query Failed: SELECT 
                    ea.email_address,
                    ea.email_address_caps,
                    ea.invalid_email,
                    ea.opt_out,
                    ea.confirm_opt_in,
                    ea.date_created,
                    ea.date_modified,
                    ear.id,
                    ear.email_address_id,
                    ear.bean_id,
                    ear.bean_module,
                    ear.primary_address,
                    ear.reply_to_address,
                    ear.deleted
                FROM email_addresses ea LEFT JOIN email_addr_bean_rel ear ON ea.id = ear.email_address_id
                WHERE 
                    ear.bean_module = 'Users'
                    AND ear.bean_id = '1'
                    AND ear.deleted = 0
                ORDER BY ear.reply_to_address, ear.primary_address DESC: MySQL error 1054: Unknown column 'ea.confirm_opt_in' in 'field list'
Tue Jun 19 04:24:06 2018 [10551][1][FATAL] Mysqli_query failed.
Tue Jun 19 04:24:06 2018 [10551][1][FATAL]  Query Failed: SELECT 
                    ea.email_address,
                    ea.email_address_caps,
                    ea.invalid_email,
                    ea.opt_out,
                    ea.confirm_opt_in,
                    ea.date_created,
                    ea.date_modified,
                    ear.id,
                    ear.email_address_id,
                    ear.bean_id,
                    ear.bean_module,
                    ear.primary_address,
                    ear.reply_to_address,
                    ear.deleted
                FROM email_addresses ea LEFT JOIN email_addr_bean_rel ear ON ea.id = ear.email_address_id
                WHERE 
                    ear.bean_module = 'Users'
                    AND ear.bean_id = '1'
                    AND ear.deleted = 0
                ORDER BY ear.reply_to_address, ear.primary_address DESC: MySQL error 1054: Unknown column 'ea.confirm_opt_in' in 'field list'
Tue Jun 19 04:24:13 2018 [11000][1][FATAL] Mysqli_query failed.
Tue Jun 19 04:24:13 2018 [11000][1][FATAL]  Query Failed: SELECT 
                    ea.email_address,
                    ea.email_address_caps,
                    ea.invalid_email,
                    ea.opt_out,
                    ea.confirm_opt_in,
                    ea.date_created,
                    ea.date_modified,
                    ear.id,
                    ear.email_address_id,
                    ear.bean_id,
                    ear.bean_module,
                    ear.primary_address,
                    ear.reply_to_address,
                    ear.deleted
                FROM email_addresses ea LEFT JOIN email_addr_bean_rel ear ON ea.id = ear.email_address_id
                WHERE 
                    ear.bean_module = 'Users'
                    AND ear.bean_id = '1'
                    AND ear.deleted = 0
                ORDER BY ear.reply_to_address, ear.primary_address DESC: MySQL error 1054: Unknown column 'ea.confirm_opt_in' in 'field list'
Tue Jun 19 04:25:24 2018 [15498][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Tue Jun 19 04:27:29 2018 [24258][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Tue Jun 19 04:27:42 2018 [24955][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Tue Jun 19 04:28:41 2018 [29065][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Tue Jun 19 04:29:22 2018 [31223][1][FATAL] Class Connectors does not exist, unable to rename.
Tue Jun 19 04:29:22 2018 [31223][1][FATAL] Class Version does not exist, unable to rename.
Tue Jun 19 04:29:22 2018 [31223][1][FATAL] Class CustomFields does not exist, unable to rename.
Tue Jun 19 04:29:22 2018 [31223][1][FATAL] Class Audit does not exist, unable to rename.
Tue Jun 19 04:30:09 2018 [33913][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Tue Jun 19 04:31:52 2018 [39922][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Tue Jun 19 04:34:19 2018 [49346][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Tue Jun 19 04:54:38 2018 [12973][-none-][FATAL] SECURITY: User authentication for Angel Navarro failed
Tue Jun 19 04:54:38 2018 [12973][-none-][FATAL] FAILED LOGIN:attempts[1], ip[77.104.139.126], username[Angel Navarro]
Tue Jun 19 04:54:42 2018 [13172][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Tue Jun 19 06:40:45 2018 [25970][1][FATAL] IP Address mismatch: SESSION IP: 2605:e000:ab61:9200:2977:9e5e:aeec:41f CLIENT IP: 2605:e000:ab61:9200:7c6f:7ae4:83c6:32a1
Thu Jun 21 21:54:06 2018 [27734][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Thu Jun 21 21:54:33 2018 [29997][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Thu Jun 21 21:54:40 2018 [30366][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Thu Jun 21 21:54:47 2018 [30765][1][FATAL] ERROR: rmdir_recursive(): argument cache/themes/SuiteP/modules is not a file or a dir.
Thu Jun 21 21:54:47 2018 [30785][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Thu Jun 21 21:55:46 2018 [35052][1][FATAL] ERROR: rmdir_recursive(): argument cache/themes/SuiteP/modules is not a file or a dir.
Thu Jun 21 21:55:47 2018 [35059][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Thu Jun 21 21:56:32 2018 [38932][1][FATAL] ERROR: rmdir_recursive(): argument cache/themes/SuiteP/modules is not a file or a dir.
Thu Jun 21 21:56:32 2018 [38948][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set
Thu Jun 21 21:57:02 2018 [41171][1][FATAL] log call at: modules/Administration/index.tpl:54 - MY_FRAME is not set

Hello,

Since I can’t seem to uninstall the module or fix the code to have the dashlet appear correctly onto my SuiteCRM home page correctly, I am just going to have to roll back to my previous installation where it was working correctly. Then upgrade, and try again.

I will retest creating a new module and add it to my homepage to see if it is possible without any bugs.

Ok, your approach looks sound.

A couple of advices:

  • make sure you find out your web server log before starting. Go in Apache’s configuration file to learn the log name and path.

  • keep track of the times when you are doing things. It really helps, when looking at logs, to know: these errors are during upgrade, these are during deploy, these are when Detail view page is showing, etc.

1 Like