Skip to Content Skip to Menu

[SOLVED] Compatibility Issues Between CB and SmartFormer

  • jstec
  • jstec
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
13 years 9 months ago - 13 years 9 months ago #150369 by jstec
I have been looking at using SmartFormer for its capabilities in putting together complex forms. I had it installed and working properly but then after installing CB (and also CBSubs) -- both latest versions -- on my site, the SmartFormer forms stopped working properly and gave the following error:

Fatal error: Cannot redeclare unhtmlentities() (previously declared in /home/content/23/7123723/html/lpp.home/components/com_smartformer/engine.php:42) in /home/content/23/7123723/html/lpp.home/administrator/components/com_comprofiler/comprofiler.class.php on line 1642


I don't know enough about php to debug it, but it seems pretty clear its an interaction between SmartFormer and CB. Any suggestions?

Also, I'm open to looking at other tools for my form, but I need the ability to add some programming to the data collection. Essentially, I want to fill in fields and have some calculated values in other fields adjust on the fly.

Thanks.
Last edit: 13 years 9 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
13 years 9 months ago #150505 by krileon
CB is still working to remove its generic functions, but for the time being you should edit out the function within SmartFormer or do not run them side by side.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • jstec
  • jstec
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
13 years 9 months ago #150521 by jstec
Krileon,

Given that I am not a PHP programmer and am not familiar with what the code in question does, I am hesitant to just edit it out without trying to understand what other problems this might cause (besides the obvious one that I will have to keep track of the hacks in order to re-hack them after a future upgrade "un-hacks" them).

But I did take a look at the code and found that on the CB side, it looks like the code isn't needed, given that I am on CB 1.3.1:
Code:
/** * @deprecated CB 1.2.2 (not used at all in CB and CB Team plugins after CB 1.2.2, so can be removed) * Legacy function: use CBTxt::html_entity_decode( $string ) instead ! */ function unhtmlentities( $string, $quotes = ENT_COMPAT, $charset = "ISO-8859-1" ) { return CBTxt::_unhtmlentities( $string, $quotes, $charset ); }

So it looks like I can just extend the comment around the function definition?

On the Smartformer side, the code that is conflicting is:
Code:
function unhtmlentities($string) { $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); }
Thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
13 years 9 months ago #150525 by krileon
As seen in the comment the function is depreciated in CB. I believe you can safely just edit it out as it is not used except in much older plugins. You can either highlight it and press Delete or remove */ from the comment and add it back in after the }.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: jstec

Please Log in or Create an account to join the conversation.

  • jstec
  • jstec
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
13 years 9 months ago #150543 by jstec
Looks like this fixed my issue. Thanks!

Please Log in or Create an account to join the conversation.

  • sbartrum
  • sbartrum
  • OFFLINE
  • Posts: 20
  • Thanks: 0
  • Karma: 0
12 years 7 months ago - 12 years 7 months ago #193462 by sbartrum
I'm having this issue, too. In what file do I apply the above fix?

(Never mind. I read the error message pasted above more closely. The one I was getting wasn't that detailed)
Last edit: 12 years 7 months ago by sbartrum.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum