0

Has anyone successfully gotten CiviRebux installed and working? UPDATE: If you have CiviRebux running, would you be willing to post a comment with the version of MySQL that your server is running?

The blog post and video demo look great but I have not had any luck getting it to function. I run into a fatal syntax error:

[code] => -2
[message] => DB Error: syntax error
[mode] => 16
[debug_info] => CREATE TRIGGER civicrm_civirebux_configuration_after_insert after insert ON civicrm_civirebux_configuration FOR EACH ROW BEGIN  IF ( @civicrm_disable_logging IS NULL OR @civicrm_disable_logging = 0 ) THEN INSERT INTO log_civicrm_civirebux_configuration (id, name, renderer, aggregator, vals, rows, cols, time, desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW.renderer, NEW.aggregator, NEW.vals, NEW.rows, NEW.cols, NEW.time, NEW.desc, NEW.type, CONNECTION_ID(), @civicrm_user_id, 'insert'); END IF; END [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW' at line 1]
[type] => DB_Error
[user_info] => CREATE TRIGGER civicrm_civirebux_configuration_after_insert after insert ON civicrm_civirebux_configuration FOR EACH ROW BEGIN  IF ( @civicrm_disable_logging IS NULL OR @civicrm_disable_logging = 0 ) THEN INSERT INTO log_civicrm_civirebux_configuration (id, name, renderer, aggregator, vals, rows, cols, time, desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW.renderer, NEW.aggregator, NEW.vals, NEW.rows, NEW.cols, NEW.time, NEW.desc, NEW.type, CONNECTION_ID(), @civicrm_user_id, 'insert'); END IF; END [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW' at line 1]
[to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TRIGGER civicrm_civirebux_configuration_after_insert after insert ON civicrm_civirebux_configuration FOR EACH ROW BEGIN  IF ( @civicrm_disable_logging IS NULL OR @civicrm_disable_logging = 0 ) THEN INSERT INTO log_civicrm_civirebux_configuration (id, name, renderer, aggregator, vals, rows, cols, time, desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW.renderer, NEW.aggregator, NEW.vals, NEW.rows, NEW.cols, NEW.time, NEW.desc, NEW.type, CONNECTION_ID(), @civicrm_user_id, 'insert'); END IF; END [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW' at line 1]"]
)

Versions:

  • PHP 5.5.38
  • MySQL 5.5.52-cll
  • Which version of Civi are you using? I had that (or similar) on 4.6, then discovered it's 4.7 minimum. – Andrew West Oct 13 '16 at 14:39
  • I'm pretty sure the site I tested on was 4.7 but will try again to be sure. – Laryn - CEDC.org Oct 17 '16 at 18:42
  • Just tested again and the issue still occurs -- and it's definitely 4.7 :) – Laryn - CEDC.org Feb 13 '17 at 22:42
5

As Chris says, the problem is due to CiviCRM's Data Logging feature having a problem with column names that are MySQL reserved words. As John says, in this case it's the column named desc.

I think this is a bug in Civi logging rather than in the extension: it's allowed in MySQL to have a column name that is a reserved word, provided it is properly escaped when referred to. Civi logging should deal with that.

I have filed an issue: SQL syntax error creating logging triggers if column name is reserved word and tested a fix against 4.6.27, which from a quick look at the code should apply to 4.7 too - I'm going to test that and create a pull request. If you test the fix, please leave a comment on the issue with your results.

Update 20 Jun 2017: I've now replicated the problem with the latest 4.6 & 4.7 (master) code and verified that the fix (suitably adapted) works for both versions. Created PRs for 4.6 & 4.7 . The 4.7 one has been merged and the issue marked fixed.

2

I put in a pull request to rename that column: https://github.com/ypranay/org.civicrm.civirebux/pull/7

1

It seems there is some buggy functionality in CiviRebux that prevents an installation on some servers.

@ypranay: "Seems that the error is because of the settings of the MySQL server on which your site is hosted. Depending on the server, the SQL syntax will have to be changed."

No solution has been found yet.

Most recent error/issue report by @petednz:

0

From what is described above, it sounds like CiviRebux may be incompatible with CiviCRM's Data Logging feature.

If the option "Logging" is enabled at civicrm/admin/setting/misc then you're going to run into these issues when trigger generation is called on any tables created by CiviRebux which use MySQL reserved words as column names.

-1

Based on nothing, "desc" doesn't seem like a likely column name, and it's where the error occurs.

Does this match the name of a column in your database?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.