Multiple php errors
Posted: 22 December 2010 12:37 PM   [ Ignore ]
Wallflower
Rank
Total Posts:  4
Joined  2010-12-15

Hi, I’m getting the following three errors:

A PHP Error was encountered

Severity: Warning

Message: preg_split() expects parameter 2 to be string, object given

Filename: libraries/safecracker_lib.php

Line Number: 1979

———-

A PHP Error was encountered

Severity: Warning

Message: Invalid argument supplied for foreach()

Filename: libraries/safecracker_lib.php

Line Number: 1979

————

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/vg004web03/94/79/XXXXXX/web/system/codeigniter/system/core/Exceptions.php:170)

Filename: core/Common.php

Line Number: 405

Here’s the page code:

                  {exp:safecracker channel="section_settings" return="setup_wizard/section1_confirm/ENTRY_ID" entry_id="{segment_3}” preview=“setup_wizard/section1_enter”}
                  <div><label>Section Name</label><input type=“text” name=“title” id=“title” value=”{title}” size=“20” maxlength=“20”><input type=“text” name=“url_title”  id=‘url_title’ value=”{url_title}” maxlength=“75” size=“50” ></div>
                  <div class=”{color_class}”><label>Section Color</label>{options:sec_section_color}
                      <input type=“radio” name=“sec_section_color” value=”{option_value}” {checked} />{option_name}</label>
                      {/options:sec_section_color}  </div>
                  <div><label>Feed Address</label><input type=“text” name=“sec_rss” id=“sec_rss” value=”{sec_rss}” size=“20” maxlength=“256”></div>
{!-- <div><label>Feed Address</label><input type="text" name="{sec_rss}” id=”{sec_rss}” value=”{sec_rss}” size=“20” maxlength=“256”></div>—}
                  <div><label><input type=“checkbox” name=“sec_if_rss_special” value=“y” {sec_if_rss_special} />Will you include a special listing feed for this section, i.e., sports scores, movie times, stock listings, etc? </label></div>
                  <div><label>Feed Address</label><select name=“sec_rss_special” id=“sec_rss_special”>
                      {options:sec_rss_special}
                        <option value=”{option_value}”{selected}>{option_name}</option>
                      {/options:sec_rss_special}
                      </select>
                  <div><label>Special Feed Address</label><input type=“text” name=“sec_rss_special” id=“sec_rss_special” value=”{sec_rss_special}” size=“20” maxlength=“256”></div>
{!-- <div><label>Special Feed Address</label><input type="text" name="sec_rss_special" id="sec_rss_special" value="{sec_rss_special}” size=“20” maxlength=“256”></div>
                  <div><label>Section Order</label><select id=”{sec_order}” name=”{sec_order}”>
                      {options}<option value=”{option_value}”{selected}>{option_name}</option>{/options}

                      </select></div>
                  <div><input type=“submit” name=“submit” value=“Submit” /></div>

                </div><!—/.entry—>

          </div><!—/.post—>
          {/exp:safecracker}

Also, on this entry form, the tag values are filling in with the channel custom field instead of being blank. Thoughts on where to begin?

Profile
 
 
Posted: 22 December 2010 07:59 PM   [ Ignore ]   [ # 1 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Hi, this is a known bug when using the Pre-Populate option for a select/checkboxes/multiselect or radio field. We’ll have a fix soon.

Also, the reason the tag values are filling in is because you are specifying entry_id=”{segment_3}”.

Profile
 
 
Posted: 23 December 2010 05:53 AM   [ Ignore ]   [ # 2 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-12-23

Hi Rob,
This is my first time posting on this forum after purchasing Safecracker..

I also have a kind of similar php error:

A PHP Error was encountered

Severity: Notice

Message: Indirect modification of overloaded property Api::$apis has no effect

Filename: libraries/safecracker_lib.php

Line Number: 1033

A PHP Error was encountered

Severity: Notice

Message: Undefined property: EE::$api_sc_channel_entries

Filename: libraries/safecracker_lib.php

Line Number: 1119


Fatal error: Call to a member function update_entry() on a non-object in /home/omarhuda/gesundheit/expressionengine/third_party/safecracker/libraries/safecracker_lib.php on line 1119

 

and here is my form code:

{exp:safecracker channel="apartment" return="apartment/edit/URL_TITLE"  url_title="{segment_3}" preserve_checkboxes="yes"}

        
<class="form_item">
        <
label for="square_area_apt">Ù?ساحة Ø§Ù?Ø´Ù?Ø©</label>
        <
input type="text" name="square_area_apt" id="square_area_apt" value="{square_area_apt}" size="25" maxlength="25" /></p>

        <
class="form_item"><label for="square_area_as_per_contract">Ù?ساحة Ø§Ù?Ø´Ù?Ø© Ø­Ø³Ø¨ Ø¹Ù?د Ø§Ù?Ø´Ù?Ø©</label>
        <
input type="text" name="square_area_as_per_contract" id="square_area_as_per_contract" value="{square_area_as_per_contract}" size="25" maxlength="25" /></p>
        
        <
class="form_item"><label for="prvt_garden">حدÙ?Ù?Ø© Ø®Ø§ØµØ©</label>
        
{options:prvt_garden}{option_value}<input type="radio" name="prvt_garden" id="prvt_garden" value="{option_value}"{checked} />{/options:prvt_garden}</p>

        <
class="form_item>"<label for="square_area_garden">Ù?ساحة Ø§Ù?حدÙ?Ù?Ø©</label>
        <
input type="text" name="square_area_garden" id="square_area_garden" value="{square_area_garden}" size="25" maxlength="25" /></p>
        
        <
class="form_item"><label for="orientation_apt">اÙ?إتجاÙ?ات</label>
        
{options:orientation_apt}{option_name}<input type="checkbox" id="{orientation_apt}" name="orientation_apt[]" value="{option_value}" {checked} />{/options:orientation_apt}</p>

        <
class="form_item"><label for="no_bathrooms">عدد Ø§Ù?Ø­Ù?اÙ?ات</label>
        <
select name="no_bathrooms">
            
{options:no_bathrooms}
            
<option value="{option_value}"{selected}>{option_name}</option>
            
{/options:no_bathrooms}
        
</select></p>

        <
class="form_item"><label for="delivery_status">حاÙ?Ø© Ø§Ù?إستÙ?اÙ?</label>
        
{options:delivery_status}{option_value}<input type="radio" name="delivery_status" id="delivery_status" value="{option_value}"{checked} />{/options:delivery_status}</p>

        <
class="form_item"><label for="date_delivery">تارÙ?Ø® Ø§Ù?إستÙ?اÙ?</label>
        <
input type="text" name="date_delivery" id="date_delivery" value="{date_delivery}" maxlength="25" size="25" /></p>

               
        <
class="form_item"><label for="end_current_lease">Ù?Ù?تÙ?ÙاÙ?Ø¥Ù?جار Ø§Ù?حاÙ?ÙفÙ?</label>
        <
input type="text" name="end_current_lease" id="end_current_lease" value="{end_current_lease}" maxlength="25" size="25" /></p>    

        <
class="form_item"><label for="installments_outstanding_apt">Ù?ÙÙ?ازاÙÙ?Ù?اÙØ£Ù?ساط Ù?جبة Ø§Ù?سدادØ?</label>
        <
select name="installments_outstanding_apt">
            
{options:installments_outstanding_apt}
            
<option value="{option_value}"{selected}>{option_name}</option>
            
{/options:installments_outstanding_apt}
        
</select></p>

        <
class="form_item"><label for="value_outstanding_inst_apt">إجÙ?اÙ?ÙÙ?Ù?Ù?Ø© Ø§Ù?اÙ?ساط Ø§Ù?Ù?اجبة Ø§Ù?سداد</label>
        <
input type="text" name="value_outstanding_inst_apt" id="value_outstanding_inst_apt" value="{value_outstanding_inst_apt}" size="25" maxlength="25" /></p>

        <
class="form_item"><label for="registarion_thru_bank">Ù?ÙاÙ?تÙ?ازÙعÙطرÙ?ÙاÙ?بÙ?Ù?Ø?</label>
        <
select name="registarion_thru_bank">
            
{options:registarion_thru_bank}
            
<option value="{option_value}"{selected}>{option_name}</option>
            
{/options:registarion_thru_bank}
        
</select></p>

        <
class="form_item"><label for="date_reserved_apt">تارÙ?Ø® Ø§Ù?حجز</label>
        <
input type="text" name="date_reserved_apt" id="date_reserved_apt" value="{date_reserved_apt}" maxlength="25" size="25" /></p>

        <
class="form_item"><label for="reservation_amount_apt">دفعة Ø§Ù?حجز Ù?اÙ?تعاÙ?د</label>
        <
input type="text" name="reservation_amount_apt" id="reservation_amount_apt" value="{reservation_amount_apt}" size="25" maxlength="25" /></p>
        
        <
class="form_item"><label for="years_installments_apt">عدد Ø³Ù?Ù?ات Ø§Ù?تÙ?سÙ?Ø·</label>
        <
input type="text" name="years_installments_apt" id="years_installments_apt" value="{years_installments_apt}" size="25" maxlength="25" /></p>
        
        <
class="form_item"><label for="monthly_installment_apt">Ù?Ù?Ù?Ø© Ø§Ù?Ù?سط Ø§Ù?Ø´Ù?رÙ?</label>
        <
input type="text" name="monthly_installment_apt" id="monthly_installment_apt" value="{monthly_installment_apt}" size="25" maxlength="25" /></p>

        <
class="form_item"><label for="notes_monthly_installament_apt">Ù?Ù?احظات Ø¹Ù?ÙاÙ?Ù?سط Ø§Ù?Ø´Ù?رÙ?</label>
        <
input type="text" name="notes_monthly_installament_apt" id="notes_monthly_installament_apt" value="{notes_monthly_installament_apt}" size="25" maxlength="25" /></p

I am sorry for my long form code…
But I have even checked my form with only the first form element included after deleting all other elements but still had the same error message..

Could you give me some hints here??
Thank you in advance..

Profile
 
 
Posted: 23 December 2010 08:32 AM   [ Ignore ]   [ # 3 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Which versions of EE and SafeCracker do you have?

Profile
 
 
Posted: 23 December 2010 08:58 AM   [ Ignore ]   [ # 4 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-12-23

I have just installed EE version 2.1.3 and I have checked with same error messages
My Safecracker Beta - Build 20101102

Thanks

Profile
 
 
Posted: 23 December 2010 09:09 AM   [ Ignore ]   [ # 5 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-12-23

Actually I have noticed that You had a Safecracker update as of Today..Dec.22 could you also guide me how to make a safe update..??
Thanks

Profile
 
 
Posted: 23 December 2010 10:29 AM   [ Ignore ]   [ # 6 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Yes, you’ll need to update to the latest version for 2.1.3 compatibility. All you need to do to update is upload the new files, replacing the old ones.

Profile
 
 
Posted: 24 December 2010 08:20 AM   [ Ignore ]   [ # 7 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-12-23

Hi Rob,

I have just updated my Safecracker files to the last version as well. Unfortunately I am still getting those PHP error messages:

A PHP Error was encountered

Severity
Notice

Message
: Array to string conversion

Filename
libraries/Functions.php

Line Number
1429

A PHP Error was encountered

Severity
Notice

Message
: Array to string conversion

Filename
libraries/Functions.php

Line Number
1429

A PHP Error was encountered

Severity
Notice

Message
: Array to string conversion

Filename
libraries/Functions.php

Line Number
1429

A PHP Error was encountered

Severity
Notice

Message
: Array to string conversion

Filename
libraries/Functions.php

Line Number
1429

A PHP Error was encountered

Severity
Warning

Message
Cannot modify header information headers already sent by (output started at /home/omarhuda/starke_gesundheit/codeigniter/system/core/Exceptions.php:170)

Filenamelibraries/Functions.php

Line Number
387 

I hate to disturb you on Christmas..!!

Thanks again

Profile
 
 
Posted: 24 December 2010 08:22 AM   [ Ignore ]   [ # 8 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-12-23

forgot to mention that my template hasn’t changed, The same as above..

Profile
 
 
Posted: 24 December 2010 08:58 AM   [ Ignore ]   [ # 9 ]
Absolute Heartthrob!
Avatar
RankRankRankRankRank
Total Posts:  10369
Joined  2008-09-29

The error that’s being reported is actually referencing EE files. “libraries/Functions.php” is an EE file.  It looks similar to the previous errors, but these reference EE’s files, not SafeCracker’s. The line in question in the EE file relates to categories in EE. I’m surprised that this wasn’t caught, so I wonder if there’s something else going on to cause this.

The easiest thing might be to dial down your error reporting. “Notice” errors can be ignored / suppressed. In this case, if the notices aren’t outputting, then the “warning” will probably not be reported either.

 Signature 
Profile
 
 
Posted: 26 December 2010 12:22 AM   [ Ignore ]   [ # 10 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-12-23

The line in question in the EE file relates to categories in EE. Iâ??m surprised that this wasnâ??t caught, so I wonder if thereâ??s something else going on to cause this.

Do you know of anything I could change in my categories preferences to fix that.??

The easiest thing might be to dial down your error reporting. â??Noticeâ? errors can be ignored / suppressed. In this case, if the notices arenâ??t outputting, then the â??warningâ? will probably not be reported either.

I have searched the whole EE User’s guide documentation to learn something about the error reporting settings but I haven’t’ found anything…I am relatively new to Expression Engine so I might need extra instructions…:)

I hope I would be able to use Safecracker without further errors..

Thanks…

Profile
 
 
Posted: 26 December 2010 06:34 AM   [ Ignore ]   [ # 11 ]
Absolute Heartthrob!
Avatar
RankRankRankRankRank
Total Posts:  10369
Joined  2008-09-29

to learn something about the error reporting settings but I havenâ??tâ?? found anything

The error reporting settings aren’t an EE thing, they’re a PHP thing. PHP error reporting is not something that will be in the EE manual. Normally the PHP error reporting is set in a PHP.ini file, but you *may* be able to override using your site’s .htaccess file, by adding the following:

php_flag display_errors off 

If the mild error below was corrected, it wouldn’t be an issue though anyway so you wouldn’t need to worry about the error reporting levels at the current time. PHP

Do you know of anything I could change in my categories preferences to fix that.??

The error being output is an EE error, and not a SafeCracker error. I’d suggest reporting this error in the EE forums. The function that’s throwing the error is “compile_relationship” and that’s not used by SafeCracker. Originally, yes, there was a compatibility issue with the most recent version of SafeCracker and the older version of EE, but the errors below reference EE files and code. 

A PHP Error was encountered

Severity
Notice

Message
: Array to string conversion

Filename
libraries/Functions.php

Line Number
1429

A PHP Error was encountered

Severity
Notice

Message
: Array to string conversion

Filename
libraries/Functions.php

Line Number
1429

A PHP Error was encountered

Severity
Notice

Message
: Array to string conversion

Filename
libraries/Functions.php

Line Number
1429

A PHP Error was encountered

Severity
Notice

Message
: Array to string conversion

Filename
libraries/Functions.php

Line Number
1429

A PHP Error was encountered

Severity
Warning

Message
Cannot modify header information headers already sent by (output started at /home/omarhuda/starke_gesundheit/codeigniter/system/core/Exceptions.php:170)

Filenamelibraries/Functions.php

Line Number
387 
 Signature 
Profile
 
 
Posted: 30 December 2010 08:43 AM   [ Ignore ]   [ # 12 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-12-23

Hi Chris,

Thank you for your post..It helped me a lot in understanding what’s wrong..you were right it was actually an error involving my relationships and it had nothing to do with Safecracker. I have deleted some related entries manually, directly from the database and that caused me really big problems.. I think there were other tables that those entries had ties so the omission was not 100% safe.. I have spent some time fixing those errors and now Safecracker forms are submitting just great..

Thank you guys for the great support: Rob & Chris…

May you all have a happy new year…

Profile
 
 
Posted: 06 January 2011 02:54 PM   [ Ignore ]   [ # 13 ]
Wallflower
Rank
Total Posts:  1
Joined  2010-08-31

I am getting some php errors that seem related to this post. I am running EE2.1.3 and the latest SafeCracker. The issues seem to be all related to safecracker files though.

A PHP Error was encountered

Severity: Notice

Message: Undefined index: field_show_formatting_btns

Filename: libraries/safecracker_lib.php

Line Number: 266

A PHP Error was encountered

Severity: Notice

Message: Undefined index: field_show_formatting_btns

Filename: libraries/safecracker_lib.php

Line Number: 266

A PHP Error was encountered

Severity: Notice

Message: Undefined index: field_show_formatting_btns

Filename: libraries/safecracker_lib.php

Line Number: 266

A PHP Error was encountered

Severity: Notice

Message: Undefined index: field_show_formatting_btns

Filename: libraries/safecracker_lib.php

Line Number: 266

A PHP Error was encountered

Severity: Notice

Message: Undefined index: field_show_formatting_btns

Filename: libraries/safecracker_lib.php

Line Number: 266

A PHP Error was encountered

Severity: Notice

Message: Undefined index: field_show_formatting_btns

Filename: libraries/safecracker_lib.php

Line Number: 266

A PHP Error was encountered

Severity: Notice

Message: Undefined index: field_show_formatting_btns

Filename: libraries/safecracker_lib.php

Line Number: 266

A PHP Error was encountered

Severity: Notice

Message: Undefined index: field_show_formatting_btns

Filename: libraries/safecracker_lib.php

Line Number: 266

A PHP Error was encountered

Severity: Notice

Message: Undefined index: field_show_formatting_btns

Filename: libraries/safecracker_lib.php

Line Number: 266

A PHP Error was encountered

Severity: Notice

Message: Undefined index: field_show_formatting_btns

Filename: libraries/safecracker_lib.php

Line Number: 266

Profile
 
 
Posted: 06 January 2011 10:59 PM   [ Ignore ]   [ # 14 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Can you make this edit to /system/expressionengine/third_party/safecracker/libraries/safecracker_lib.php on line 266:

Change this:

'field_show_formatting_btns' => ($field['field_show_formatting_btns'== 'n') ? 1

To this:

'field_show_formatting_btns' => (isset($field['field_show_formatting_btns']) && $field['field_show_formatting_btns'== 'y') ? 0
Profile
 
 
Posted: 14 January 2011 02:11 AM   [ Ignore ]   [ # 15 ]
Wallflower
Rank
Total Posts:  1
Joined  2011-01-08

I ran into the same problem, used Rob’s code change in the -lib file, and it seems to be working now… (same configuration of EE 2.1.3 and SC 1.0.2) FWIW

Profile
 
 
   
 
 
‹‹ edit_link to SC      Thanks for Rob ››