Hello.
I have created a custom view for the Lead object (i.e. not an EditView, DetailView, etc) and I would like to be able to edit the layout using Studio. Having looked at the relevant code, I can see that I need to create a class in custom/modules/Leads called LeadsStudioModule.php, which I have done:
<?php
require_once 'modules/ModuleBuilder/Module/StudioModule.php' ;
class LeadsStudioModule extends StudioModule
{
public function __construct($module)
{
parent::__construct($module);
$this->sources['createfromcaseviewdefs.php'] = array (
'name' => 'CREATE', // translate('LBL_EDITVIEW'),
'type' => 'createfromcaseview', //MB_EDITVIEW,
'image' => 'EditView',
'view' => 'createfromcaseview',
);
}
}
At this point, my new view appears in the Layout tab for Leads in Studio. However, when I click on it, I get “[FATAL] Action = editLayout with unknown view=createfromcaseview” in the log. This is coming from ModuleBuilderController:
public function action_editLayout()
{
$view = strtolower($_REQUEST [ 'view' ]);
$found = false;
//Check the StudioModule first for mapping overrides
if (empty($_REQUEST [ 'view_package' ])|| $_REQUEST [ 'view_package' ] == "studio") {
$sm = StudioModuleFactory::getStudioModule($_REQUEST [ 'view_module' ]);
foreach ($sm->sources as $file => $def) {
if (!empty($def['type']) && !empty($def['view']) && $def['view'] == $view) {
$view = $def['type'];
}
}
}
if (!$found) {
switch ($view) {
case MB_EDITVIEW:
case MB_DETAILVIEW:
case MB_QUICKCREATE:
$this->view = 'layoutView' ;
break ;
case MB_LISTVIEW:
$this->view = 'listView' ;
break ;
case MB_BASICSEARCH:
case MB_ADVANCEDSEARCH:
$this->view = 'searchView' ;
break ;
case MB_DASHLET:
case MB_DASHLETSEARCH:
$this->view = 'dashlet' ;
break ;
case MB_POPUPLIST:
case MB_POPUPSEARCH:
$this->view = 'popupview' ;
break ;
default:
$GLOBALS [ 'log' ]->fatal('Action = editLayout with unknown view=' . $_REQUEST [ 'view' ]) ;
}
}
}
This seems wrong to me, as $found is never set, however it may just be that I am not understanding what it is supposed to be doing.
Can anyone shed some light on this?
Thanks,
Carl