kratos
kratos

Reputation: 2495

Unable to create package in module builder or Deploy a new package in SuiteCRM

I am unable to create a new package from module builder. In module builder, when I enter a package name and key and hit save, it does nothing. When I inspect in chrome, the console logs the following error:

 Uncaught TypeError: Cannot read property 'value' of undefined
    at validate_form (sugar_grp1.js:228)
    at check_form (sugar_grp1.js:160)
    at Object.handleSave (ModuleBuilder.js:905)
    at HTMLInputElement.onclick (/XXXXXX/index.php?module=ModuleBuilder&action=index&type=mb#ajaxUILoc=&mbContent=module%3DModuleBuilder%26action%3Dpackage%26new%3D1:1)

Any suggestions on what I can look at or do to debug?

  1. I'm using SuiteCRM 7.7.8
  2. Php 7
  3. I thought this might be a permissions issue, so i made sure all folders and files are 755 and tried to create the package again but got the same error.
  4. I do not have any custom modules. this was the first one im trying to build.
  5. I get similar errors if i try to export a module in studio also.
  6. When I dig deeper, the exact line that fails in sugar_grp1.js is var current_module=document.getElementsByName("view_module")[0].value; There is no element with name view_module on the page. It appears that this is happening to other users also. Please see: https://suitecrm.com/community/forum/suitecrm-7-0-discussion/12418-unable-to-create-package-in-module-builder#42665

UPDATE: I have done the usual repair and rebuild everything along with JS groupings and JS. Still the same.

Upvotes: 3

Views: 618

Answers (1)

Limbertc
Limbertc

Reputation: 31

An easy solution, see following steps:

  1. Open /cache/include/javascript/sugar_grp1.js
  2. Go to line 228 or find the next text:

    var current_fields='';var current_module=document.getElementsByName("view_module")[0].value;$.ajax({type:"GET",url:"index.php?to_pdf=1&module=ModuleBuilder&action=getModuleFields&current_module="+current_module,async:false,success:function(result){current_fields=JSON.parse(result);},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");}});for(k=0;k<current_fields.length;k++){if(isError!=true){val=current_fields[k].toUpperCase();if((operator=="=="&&val==item1)||(operator=="!="&&val!=item1)){isError=true;add_error_style(formname,validate[formname][i][nameIndex],'Invalid Value: Field Name already exists');}}}
    
  3. Remove this line.

  4. QuickRepair.
  5. Clear your Browser Cache and try again.

Upvotes: 1

Related Questions