Skip to content

Commit

Permalink
Added submission debugging, so &fabrikdebug=2 will bypass any and all
Browse files Browse the repository at this point in the history
redirects, so we can see profile info, etc.
  • Loading branch information
cheesegrits committed Aug 22, 2014
1 parent 8fae02c commit e491118
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/com_fabrik/controllers/form.php
Expand Up @@ -254,6 +254,16 @@ public function process()

return;
}

/**
* If debug submit is requested (&fabrikdebug=2, and J! debug on, and Fabrik degbu allowed),
* bypass any and all redirects, so we can see the profile for the submit
*/

if (FabrikHelperHTML::isDebugSubmit())
{
return;
}

$listModel = $model->getListModel();
$listModel->set('_table', null);
Expand Down
23 changes: 23 additions & 0 deletions components/com_fabrik/helpers/html.php
Expand Up @@ -1328,6 +1328,29 @@ public static function isDebug($enabled = false)
return $debug === 1 || $app->input->get('fabrikdebug', 0) == 1;
}

/**
* Returns true if either J! system debug is true, and &fabrikdebug=2,
* will then bypass ALL redirects, so we can see J! profile info.
*
* @return bool
*/

public static function isDebugSubmit($enabled = false)
{
$app = JFactory::getApplication();
$config = JComponentHelper::getParams('com_fabrik');

if ($config->get('use_fabrikdebug') == 0)
{
return false;
}

$jconfig = JFactory::getConfig();
$debug = (int) $jconfig->get('debug');

return $debug === 1 && $app->input->get('fabrikdebug', 0) == 2;
}

/**
* Wrapper for JHTML::Script() loading with require.js
* If not debugging will replace file names .js => -min.js
Expand Down

0 comments on commit e491118

Please sign in to comment.