dynamic_title parameter creating php errors!!!
Posted: 25 May 2011 08:44 AM   [ Ignore ]
Wallflower
Rank
Total Posts:  5
Joined  2011-05-25

I just did a complete reinstall of EE with a brand new database because I was experiencing php errors after I tried to use dynamic_title in SafeCracker.  After reinstall things were working fine until I tried to use dynamic_title.  I get these php errors:

A PHP Error was encountered

Severity
User Warning

Message
unexpected operator '+'

Filenamelibraries/Evalmath.php

Line Number
361

A PHP Error was encountered

Severity
Warning

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

Filenamecore/Common.php

Line Number
405


Fatal error
ob_start() [<a href='ref.outcontrol'>ref.outcontrol</a>]Cannot use output buffering in output buffering display handlers in /home/native5/public_html/buybees/nb_admin/codeigniter/system/core/Exceptions.php on line 166 

Im not sure if this is because I was using a select_dropdown field as my custom field to generate the dynamic_title or what.  I realize that these are php errors maybe unrelated to SC but I already tried posting my first php errors to EE Forums (see thread here) and I am getting no help there.  Now my site is messed up again because I removed dynamic_title and went back to a simple SC form and now I get these same errors no matter what (both on new entry and edit).

I really need to be able to use SafeCracker and use dynamic_title.

HELP PLEASE!!!

Profile
 
 
Posted: 25 May 2011 09:03 AM   [ Ignore ]   [ # 1 ]
Absolute Heartthrob!
Avatar
RankRankRankRankRank
Total Posts:  10369
Joined  2008-09-29

Are you also using CartThrob? I don’t think that SafeCracker uses the Evalmath library. CartThrob however, does. Let me know.

 Signature 
Profile
 
 
Posted: 25 May 2011 06:02 PM   [ Ignore ]   [ # 2 ]
Wallflower
Rank
Total Posts:  5
Joined  2011-05-25

Yes.  I am using CT and I am using math_plus plugin to add total value of {males} + {females} custom fields.  I suppose I could use CT for this.  Does CT add any custom fields with the arithmetic expression?

Here is my form to collect data:

{exp:safecracker channel="bees" return="bees/bees" url_title="{segment_3}"}

        
<label for="title">Title</label>edit
        
<input type="title" name="title" id="title" value="{title}" size="50" maxlength="100"><br />

        <
input type="hidden" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50" />
    
        <
input type="hidden" name="entry_date" id="entry_date" value="{entry_date}" maxlength="23" size="25" />
        
        <
label for="common_name">Common Name</label>
        <
select name="common_name" id="common_name">
            
{options:common_name}
            
<option value="{option_value}"{selected}>{option_name}</option>
            
{/options:common_name}
        
</select><br />
        
        <
label for="species">Species</label>
        <
select name="species" id="species">
            
{options:species}
            
<option value="{option_value}"{selected}>{option_name}</option>
            
{/options:species}
        
</select><br />
        
        <
label for="origin">Origin</label>
        <
select name="origin" id="origin">
            
{options:origin}
            
<option value="{option_value}"{selected}>{option_name}</option>
            
{/options:origin}
        
</select><br />

        <
label for="grade">Grade</label>
        <
select name="grade" id="grade">
            
{options:grade}
            
<option value="{option_value}"{selected}>{option_name}</option>
            
{/options:grade}
        
</select><br />
        
        <
label for="description">Description</label>
        <
input type="text" name="description" id="description" value="{description}" /><br />
                        
        <
label for="males">Males</label>
        <
input type="text" name="males" id="males" value="{males}" /><br />
    
        <
label for="females">Females</label>
        <
input type="text" name="females" id="females" value="{females}" /><br />
        
        <
label for="beekeeper_thumbnail">Thumbnail Image (50x50 pixels)</label>
        
{field:beekeeper_thumbnail}
        
            
<label for="beekeeper_image">Full-Size Image (300x300 pixels)</label>
        
{field:beekeeper_image}
        
        
<label for="price">Price</label>
        <
input type="text" name="price" id="price" value="{price}" /><br />
        
        <
label for="shipping">Shipping</label>
        <
input type="text" name="shipping" id="shipping" value="{shipping}" /><br />

            <
input type="submit" name="submit" value="Submit" />
{/exp:safecracker} 

And here is the return display code for the products listing (bees):

{exp:channel:entries channel="bees" limit="100"}
                
<tr>
                    
                    <
td><class="lightBox" href="#" tabindex="1"><img src="{beekeeper_thumbnail}" class="thumb" /></a>
                    <
div class="cssBox p1">
                        <
div class="back"></div>
                        <
div class="holder">
                            <
span id="edge"></span>
                            <
div id="container">
                                <
div class="frame">
                                    <
img src="{beekeeper_image}" />
                                    <
div class="caption">
                                        <
h4>{common_name} - <em>{species}</em></h4>
                                        <
class="description">{description}</p>
                                    </
div>
                                    <
img class="close" src="/images/close.png" alt="" />
                                </
div>
                            </
div>
                        </
div>
                    </
div> <a href="{path=bees/edit/{url_title}}">{common_name}</a><br /><em>{species}</em></td>
                    <
td>{origin}</td>
                    <
td>{exp:math_plus calculate="{males} + {females}"}
                    {math_plus_result}
                    {
/exp:math_plus}({females} females{males} males)</td>
                    <
td>{grade}</td>
                     <
td>Shipping{shipping}<br />Subtotal{price}<br /></td>
                    <
td>{exp:cartthrob:arithmetic expression="{price:numeric} + {shipping:numeric}"
                    
</td>
                </
tr>
             
{/exp:channel:entries} 
Profile
 
 
Posted: 25 May 2011 06:20 PM   [ Ignore ]   [ # 3 ]
Absolute Heartthrob!
Avatar
RankRankRankRankRank
Total Posts:  10369
Joined  2008-09-29

This, I think is what’s causing the error. Is one of those values blank?

{exp:cartthrob:arithmetic expression="{price:numeric} + {shipping:numeric}"

CartThrob’s library should be able to handle (it *should*) but my guess is, if it’s blank, it’s not evaluating correctly.

 Signature 
Profile
 
 
Posted: 25 May 2011 06:26 PM   [ Ignore ]   [ # 4 ]
Wallflower
Rank
Total Posts:  5
Joined  2011-05-25

Would it cause an error if one of those fields was blank on any one of the products in the loop?

Profile
 
 
Posted: 25 May 2011 06:31 PM   [ Ignore ]   [ # 5 ]
Wallflower
Rank
Total Posts:  5
Joined  2011-05-25

It looks like as long as none of the fields are blank then it works.  This is without using dynamic_title.  I am going to add in dynamic_title and see if it is still good.

Profile
 
 
Posted: 25 May 2011 06:31 PM   [ Ignore ]   [ # 6 ]
Absolute Heartthrob!
Avatar
RankRankRankRankRank
Total Posts:  10369
Joined  2008-09-29

That’s my guess. I don’t use that tag much, so I’m only guessing.. but based on the error, I’d guess that’s it.

 Signature 
Profile
 
 
Posted: 25 May 2011 06:34 PM   [ Ignore ]   [ # 7 ]
Wallflower
Rank
Total Posts:  5
Joined  2011-05-25

2 more questions and much thanks by the way for your help

1.  Can I use arithmetic expression with any fields?

2.  what is the proper code for dynamic title dynamic_title=”[custom_field]” or dynamic_title=”[custom_field] Submission”?

Profile
 
 
Posted: 25 May 2011 06:40 PM   [ Ignore ]   [ # 8 ]
Absolute Heartthrob!
Avatar
RankRankRankRankRank
Total Posts:  10369
Joined  2008-09-29

1. Yes.

2. Dunno. I’ll ask Rob.

 Signature 
Profile
 
 
Posted: 25 May 2011 06:41 PM   [ Ignore ]   [ # 9 ]
Wallflower
Rank
Total Posts:  5
Joined  2011-05-25

Cool.  You guys rock!

Profile
 
 
Posted: 25 May 2011 07:00 PM   [ Ignore ]   [ # 10 ]
Absolute Heartthrob!
Avatar
RankRankRankRankRank
Total Posts:  10369
Joined  2008-09-29

This from Rob:

Submission is just an example of non-dynamic text. You can have a combo of dynamic and non-dynamic text inside dynamic_title.  So… both should work.

 Signature 
Profile