anmol dubey
Member
I have an add on created for adding custom fields while creating threads - the custom fields are stores and categories

but after an update the moderator edit screen has changed and is not displaying the custom fields and i dont understand the reason.
Since the developer is out for weekend i need to fix it myself.
Below is the screen of the current edit screen which dont have the store name and category. This was working perfectly before the update.

I am not a addon developer , but i tried comparing all the files of the working addon and not working one. Below are the changes
Thread.php (Controller) - Red line added in latest update
public function actionEdit()
{
$response = parent::actionEdit();
if(!empty($response->params['forum'])){
$response->params['canPromoteThreadBRDP'] = $this->_getThreadModel()->canPromoteThread($response->params['forum']);
$response->params['tp'] = $this->getModelFromCache('DealPromotion_Model_Promotion')->getPromoteByTId($response->params['thread']['thread_id']);
}
return $response;
}
Added below in installer.php
public function getQueryBeforeData()
{
$query = array();
$query[] = "ALTER TABLE `gggg` CHANGE `promote_url` `promote_url` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL";
return $query;
}
Changed XML installation file :
<template title="thread_create_fields_main" version_id="1020200" version_string="1.2.2"><
but after an update the moderator edit screen has changed and is not displaying the custom fields and i dont understand the reason.
Since the developer is out for weekend i need to fix it myself.
Below is the screen of the current edit screen which dont have the store name and category. This was working perfectly before the update.

I am not a addon developer , but i tried comparing all the files of the working addon and not working one. Below are the changes
Thread.php (Controller) - Red line added in latest update
public function actionEdit()
{
$response = parent::actionEdit();
if(!empty($response->params['forum'])){
$response->params['canPromoteThreadBRDP'] = $this->_getThreadModel()->canPromoteThread($response->params['forum']);
$response->params['tp'] = $this->getModelFromCache('DealPromotion_Model_Promotion')->getPromoteByTId($response->params['thread']['thread_id']);
}
return $response;
}
Added below in installer.php
public function getQueryBeforeData()
{
$query = array();
$query[] = "ALTER TABLE `gggg` CHANGE `promote_url` `promote_url` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL";
return $query;
}
Changed XML installation file :
<template title="thread_create_fields_main" version_id="1020200" version_string="1.2.2"><![CDATA[<xen:if is="{$canPromoteThreadBRDP}">
Changed to
<template title="thread_create_fields_main" version_id="1020400" version_string="1.2.4"><![CDATA[<xen:if is="{$isDealForum}">
Out of the above three changes - what could have been the issue which caused the edit screen to change? Any help here will be highly appreciated !!