CMS MADE SIMPLE FORGE

JMDownMan

 

[#11263] Category editing not possible -> new category will be added instead

avatar
Created By: Simon (creopard)
Date Submitted: Tue Jan 10 10:22:19 -0500 2017

Assigned To: Fernando Morgado (JoMorg)
Version: 1.RC.2
CMSMS Version: 2.1.5
Severity: Minor
Resolution: None
State: Open
Summary:
Category editing not possible -> new category will be added instead
Detailed Description:
If you try to edit an existing category (because the description was missing for
example) the module won't edit the currrent category but instead it will add a
new one.


History

Comments
avatar
Date: 2021-03-23 10:51
Posted By: Matthijs de Bruin (mldebee)

Fix:

in templates\editcategory.tpl add this line below "{startform}"

{if !empty($hidden_id)}{$hidden_id}{/if}

in action.editcategory.php add these lines below "$smarty->assign('endform',
$this->CreateFormEnd());"

if (isset($params['category_id'])) {
$smarty->assign('hidden_id', $this->CreateInputHidden($id, 'category_id',
$params['category_id']));
}
      
avatar
Date: 2021-04-12 05:07
Posted By: Simon (creopard)

Thank you, editing now works as intended, however now a new error appears that
was hidden previously:

Fatal error: Uncaught ArgumentCountError: Too few arguments to function
JMDownMan::SearchAddCategory(), 2 passed in
/public_html/modules/JMDownMan/action.editcategory.php on line 76 and at least 3
expected in /public_html/modules/JMDownMan/JMDownMan.module.php:366 Stack trace:
#0 /public_html/modules/JMDownMan/action.editcategory.php(76)

The referenced function looks like this:
 SearchAddCategory($id, $data, $expire, &$searchM = null)