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
Screenshot
Works for me, see atttached screenshot.
Perhaps more details about your setup would help.
Anything in the server's error log?
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');
roccivic, thank you for your answer.
I'm happy to see you found the issue.
I wonder if we need to apply the fix to master...
Rouslan,
I guess you just did...
https://github.com/phpmyadmin/phpmyadmin/pull/221
I guess I did :)
closing...
But I don't see the fix in 3.5, please enlighten me...
My bad. Cherry picked and merged now.