Menu

#3705 (ok 3.5.8) Attempt to open trigger for edit gives NULL

3.5.3
fixed
1
2013-06-11
2012-10-30
Nnear
No

I try to open trigger for edit, but when I press button «edit», window opens with text «null».
Trigger's dump:

CREATE TRIGGER `billing_activated_services_log_insert_before` BEFORE INSERT ON `billing_activated_services_log`
FOR EACH ROW BEGIN
IF NEW.`operation` IS NULL OR NEW.`count` <= 0 THEN
INSERT INTO `error` (`error`) VALUES ('error');
END IF;
SET NEW.`time` = UNIX_TIMESTAMP(NOW());
IF NEW.`action` = 'add' OR NEW.`action` = 'adm_add' THEN
-- Переписать
SET NEW.`service2` = NEW.`service`;
-- Переписать
INSERT INTO `billing_activated_services`(`subject`, `service`, `count`, `begin`, `end`) VALUES (NEW.`subject`, NEW.`service2`, NEW.`count`, NEW.`begin`, NEW.`end`);
ELSE
IF NEW.`action` = 'adm_delete' THEN
SET NEW.`service2` = NEW.`service`;
DELETE FROM `billing_activated_services` WHERE `subject` = NEW.`subject` AND `service` = NEW.`service` AND `count` = NEW.`count` AND `begin` = NEW.`begin` AND `end` = NEW.`end` LIMIT 1;
IF ROW_COUNT() = 0 THEN
INSERT INTO `error` (`error`) VALUES ('error');
END IF;
ELSE
INSERT INTO `error` (`error`) VALUES ('error');
END IF;
END IF;
END

Discussion

  • Rouslan Placella

    Screenshot

     
  • Rouslan Placella

    Works for me, see atttached screenshot.
    Perhaps more details about your setup would help.
    Anything in the server's error log?

     
  • Rouslan Placella

    • status: open --> pending
     
  • Nnear

    Nnear - 2012-11-20

    Problem found. We use PHP 5.3.

    htmlentities in php less than 5.4 uses default charset ISO-8859-1 and it works incorrect with strings in UTF8. Therefore it is necessary to pass charset in htmlentities.

    In our case (PHP 5.3) in file rte_triggers.lib.php we will need to replace
    htmlentities($item[$index], ENT_QUOTES);
    by
    htmlentities($item[$index], ENT_QUOTES, 'UTF-8');

     
  • Nnear

    Nnear - 2012-11-20
    • status: pending --> open
     
  • Nnear

    Nnear - 2012-11-20

    roccivic, thank you for your answer.

     
  • Nnear

    Nnear - 2012-11-20
    • status: open --> closed-fixed
     
  • Rouslan Placella

    • status: closed-fixed --> pending
     
  • Rouslan Placella

    I'm happy to see you found the issue.

    I wonder if we need to apply the fix to master...

     
  • Marc Delisle

    Marc Delisle - 2013-01-18
    • status: pending --> open
     
  • Marc Delisle

    Marc Delisle - 2013-03-29

    Rouslan,
    I guess you just did...
    https://github.com/phpmyadmin/phpmyadmin/pull/221

     
  • Rouslan Placella

    I guess I did :)
    closing...

     
  • Rouslan Placella

    • summary: Attempt to open trigger for edit gives NULL --> (ok 4.0.0) Attempt to open trigger for edit gives NULL
    • status: open --> closed-fixed
    • assigned_to: Rouslan Placella
     
  • Marc Delisle

    Marc Delisle - 2013-03-29

    But I don't see the fix in 3.5, please enlighten me...

     
  • Rouslan Placella

    My bad. Cherry picked and merged now.

     
  • Rouslan Placella

    • summary: (ok 4.0.0) Attempt to open trigger for edit gives NULL --> (ok 3.5.8) Attempt to open trigger for edit gives NULL
    • status: closed-fixed --> open-fixed
    • priority: 5 --> 1
     
  • Marc Delisle

    Marc Delisle - 2013-04-08
    • Status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.