Skip to content

Commit

Permalink
Patch bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jegelstaff committed Oct 20, 2024
1 parent 824ea79 commit 4b57f23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion modules/formulize/admin/formindex.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ function patch40() {
// copy the contents of custom_code to code
// then renmove custom_code
$files = scandir(XOOPS_ROOT_PATH.'/modules/formulize/custom_code');
mkdir(XOOPS_ROOT_PATH.'/modules/formulize/code');
foreach ($files as $file) {
if ($file !== '.' && $file !== '..') {
$sourceFile = XOOPS_ROOT_PATH.'/modules/formulize/custom_code/'.$file;
Expand Down Expand Up @@ -802,7 +803,11 @@ function patch40() {
exit("Error detecting procedures to convert to files. SQL dump:<br>".$formProceduresSQL."<br>".$xoopsDB->error()."<br>Please contact <a href=mailto:info@formulize.org>info@formulize.org</a> for assistance.");
}

$customButtonCodeSQL = "SELECT `screen_handle`, `customactions` FROM ".$xoopsDB->prefix('formulize_screen_listofentries')." WHERE customactions LIKE '%\"custom_code\";%' OR customactions LIKE '%\"custom_html\";%'";
$customButtonCodeSQL = "SELECT s.`screen_handle`, l.`customactions`
FROM ".$xoopsDB->prefix('formulize_screen_listofentries')." AS l
LEFT JOIN ".$xoopsDB->prefix('formulize_screen')." AS s
ON l.sid = s.sid
WHERE l.customactions LIKE '%\"custom_code\";%' OR customactions LIKE '%\"custom_html\";%'";
if($res = $xoopsDB->query($customButtonCodeSQL)) {
// loop through the results...
while($record = $xoopsDB->fetchArray($res)) {
Expand Down
2 changes: 1 addition & 1 deletion modules/formulize/class/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ public function getVar($key, $format = 's') {
OR $key == 'on_delete'
OR $key == 'custom_edit_check') {
$contents = '';
if(is_numeric($this->getVar('fid'))) {
if(is_numeric($this->getVar('id_form'))) {
$form_handle = $this->getVar('form_handle');
$filename=XOOPS_ROOT_PATH."/modules/formulize/code/".$key."_".$form_handle.".php";
if(file_exists($filename)) {
Expand Down

0 comments on commit 4b57f23

Please sign in to comment.