Warning: preg_replace - PROFILE PLUGIN

laustin 28 Sep, 2009
In another forum, I found that a similar error meant the code in the plugin was missing something, so I'm guessing something's missing in the profile plugin:

Here's the warning I get:
Warning: preg_replace() [function.preg-replace]: Compilation failed: missing ) at offset 139 in (...)public_html/components/com_chronocontact/plugins/cf_profile.php on line 353

This is the code on line 353:
$options = preg_replace(array('/'.$this->skipregex($matches2[0][0]).'/is', '/<\/select>/i'), array('', ''), $match);


Please let me know if something is missing or if it's in my form.

Thank you!
GreyHead 28 Sep, 2009
Hi laustin.

Which version of ChronoForms do you have? In my copy line 353 is
preg_match_all($pattern_select, $html_string, $matches);
and the line you quote is at 359 (it is possible that I've edited my version though). And the brckets on both lines look correct :-(

This part of the code is looking for names in <select . . .> inputs. What names do you have in your form?

Bob

PS This is a PHP Warning, not an Error, you can probably supress it by setting Error Reporting to System Default in the Site Global Configuration.
laustin 28 Sep, 2009
Hi Bob,

The values I have in the Profile Plugin are:

Table Name: jos_chronoforms_S_Reg
Target Field Name: cf_id
'Request' Parameter Name: s_id
Default Request Parameter: //have tested it set to zero or left blank
Order Type: ASC
Editable: Yes
Skipped Fields: s_teacher,s_org
Evaluate Code: No

Is this what you meant?

Thank you!
laustin 28 Sep, 2009
Hi Bob,

A couple other things ...

Setting the error reporting to system default doesn't suppress this error, nor does setting it to none.

The second thing is that that line does seem to be line 353, so maybe mine is different than yours?

Is there any way I can download the .php file you have?

Thank you!
GreyHead 28 Sep, 2009
Hi lausitn,

A copy of my version attached.

Bob
laustin 28 Sep, 2009
Hi Bob,

Thank you for uploading your version.

Your copy is different, but it gives the same error at line 359 now like you noticed.

I have a field that is weird. I do have 2 drop downs that are dynamically generated, but those are the 2 fields I have told the plugin to skip. Otherwise, I have 3 text boxes and a set of check boxes. Everything fills in correctly, so if nothing comes to mind, do you know another way to hide the warning (I tried setting it to System Default and None, and neither suppressed it).

Thank you!
GreyHead 28 Sep, 2009
Hi laustin,

The error first, if it's not being changed by the Global Configuration setting then I think the next port of call is the php.ini file :-(

I think that the problem with the skipping is that ChronoForms tries to find it before it gets as far as skipping.

Can you send me a backup copy of your form so that I can see if we can find a fix.

Bob
laustin 03 Oct, 2009
Hi Bob,

Thank you for your quick reply. You guys really are the best customer service ever!

I'm sorry it has taken me so long to respond though.

I sent you a message with the backup of the form.

Thank you Bob!
GreyHead 03 Oct, 2009
Hi laustin,

I see you found the answer - zip it first. I'll take a look in the morning.

Bob
GreyHead 04 Oct, 2009
Hi laustin,

The form seems to work perfectly.I created a table using the default settings and selecting all fields; and I set up the Profile Plugin with the settings below. I see no error messages and the checkbox list is saved in the database table.

Bob

PS I suspect that the problem with the script is that the input id and name are different. I'm not sure that form.s_org.options.selectedIndex will work with the input name (I'd use the MooTools syntax so I'm far from certain about this.)
laustin 04 Oct, 2009
Hi Bob,

I think the reason that the error isn't poping up for you is because you have s_org set to 0, so the dynamically generated fields are not being populated - basically they are being skipped like they are supposed to be. I suspect you were right with your first hunch that it is trying to fill them before skipping them in the profile plugin. Since everything for me works perfectly, what can i edit in the php.ini file to suppress the warning and where is that file located?

And thank you for your insight into the id/name issue - I'll take a look into MooTools - I've never used that before.

Thanks you!
GreyHead 04 Oct, 2009
Hi laustin,

That could be the problem - if you send me backup copies of your tables I'll try putting them on my test server and see if I can debug any further.

The Error Reporting page is the PHP Manual is here

MooTools is a JavaScript framework that is installed with Joomla and often loaded on Joomla pages. However Joomla uses the 1.11 version (not the current 1.2 releases) so you need to keep an eye out for that. MooTools 1.11 docs are here

Bob
laustin 04 Oct, 2009
Hi Bob,

I will send you super admin details by email.

Thank you!
GreyHead 05 Oct, 2009
Hi laustin,

Apologies, if you sent them then I've lost them :-(

Bob
laustin 05 Oct, 2009
Hi Bob,

I've sent it to your email through your Chronoforms profile again. Let me know if you've gotten it!

Thank you!
This topic is locked and no more replies can be posted.