Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
Fatal error: Cannot redeclare class Data_sorter
Posted: 16 March 2011 08:13 AM   [ Ignore ]
Is a Really Great Dancer
RankRank
Total Posts:  61
Joined  2010-12-03

I’m getting this error on a safecracker edit form page:

Fatal errorCannot redeclare class Data_sorter in /home/portfoliocreativ/portfoliocreative.org/cp/expressionengine/third_party/cartthrob/libraries/Data_sorter.php on line 5 

Strangely there is nothing to do with Cartthrob on the page.

Here is the form:

{exp:safecracker channel="campaigns" return="account/add-asset/parent/ENTRY_ID" preserve_checkboxes="yes" error_handling="inline" id="form" class="form" include_jquery="no"}

<div class="error">
        
{if global_errors:count}
            
<ul>
            
{global_errors}
                
<li>{error}</li>
            
{/global_errors}
            
</ul>
        
{/if}
        {if field_errors
:count}
            
<ul>
            
{field_errors}
                
<li>{error}</li>
            
{/field_errors}
            
</ul>
        
{/if}
</div>


    <
input type="hidden" name="campaign_status" value="inactive" />
    <
fieldset>
        <
class="error">{error:title}</p>
        <
label>Campaign Name:</label>
        <
input type="text" name="title" id="title" value="{title}" /></input>
        
        <
class="error">{error:campaign_desc}</p>
        <
label>Description:</label>
        <
textarea name="campaign_desc" rows="6" class="word_count"></textarea>
        <
br class="clear" />
        <
span class="error" id="too-many-words" style="display:none; color:#F00">Please do not go over the 200 word limit.</span><span class="counter" style="float:right;margin-right: 36px"></span>
        <!-- 
{field:campaign_desc}-->
        <
class="hint">{instructions:campaign_desc}</p>
    </
fieldset>
        
        <
fieldset>
        <
label style="font-size:1.4em">Categories:</label>
        <
div id="checkbox-container">
            <
div class="checkboxes checkbox-row">
                <
fieldset>
                    
{categories}
                        
<label><input type="checkbox" class="checkbox" name="category[]" value="{category_id}" {checked} />{category_name}</label>
                    
{/categories}
                
</fieldset>
            </
div>
            <
br class="clear" />
        </
div>
        <
class="hint">Select which categories your campaign falls into</p>
        </
fieldset>
        
        
        <
label>Tags:</label>
        <
textarea id="tag_f" name="tag_f" value="{campaign_tags}" cols="50" rows="5"></textarea>
            <
class="hint">{instructions:campaign_tags}</p>
            <
div id="taglist" class="hint">
            
{exp:tag:cloud}
                
<span>{tag}, </span>
            
{/exp:tag:cloud}
            
</div>
    </
fieldset>
    
    <
fieldset class="inputshorter">
    <
class="error">{error:campaign_sale_price}</p>
        <
label>Campaign Sale Price (£): </label>
        
{field:campaign_sale_price}
        
<class="hint">{instructions:campaign_sale_price}</p>
        <
label>Initial Cost of Campaign (£): </label>
        
{field:campaign_initial_cost}
        
<class="hint">{instructions:campaign_initial_cost}</p>
    </
fieldset>
    <
fieldset>
        <
class="error">{error:campaign_demographic}</p>
        <
label>Demographics:</label>
        <
div id="checkbox-container">
        <
div class="checkbox-row">
            
{field:campaign_demographic}
        
</div>
        <
class="hint">{instructions:campaign_demographic}</p>
        </
div>
    </
fieldset>
    
    
    <
fieldset>
        <
class="error">{error:campaign_image}</p>
        <
label>Preview Image: </label>
            
{field:campaign_image}
            
<br class="clear" />
            <
class="hint">{instructions:campaign_image}</p>
    </
fieldset>
    <
fieldset>
        <
class="error">{error:campaign_instructions}</p>
        <
label>Special Usage Instructions:</label>
        <
textarea name="campaign_instructions" rows="6" />{campaign_instructions}</textarea>
        <
class="hint">{instructions:campaign_instructions}</p>
    </
fieldset>
    
    <
input class="btn" id="button1" type="submit" value="Create campaign and add first asset"/><span id="loading" style="display:none"><img src="{images}css/loading.gif" align="absmiddle"/> Saving campaign and uploading preview images.</span>
    <
br class="clear" />
    
{/exp:safecracker} 
[ Edited: 18 March 2011 12:55 PM by Chris Newton ]
Profile
 
 
Posted: 16 March 2011 01:34 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Does the campaigns channel have any of the CartThrob fieldtypes?

Profile
 
 
Posted: 16 March 2011 01:36 PM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

I might need to change the name of the library we include with CartThrob to avoid conflict.

Profile
 
 
Posted: 16 March 2011 01:44 PM   [ Ignore ]   [ # 3 ]
Is a Really Great Dancer
RankRank
Total Posts:  61
Joined  2010-12-03

No, it doesn’t include any Cartthrob fieldtypes.
I’m just looking into it but earlier I was getting this error for all users and now fro some reason I’m not getting it for superadmins.

It might also be worth noting that I was also getting PHP memory errors that have now been resolved, not sure of that would have any affect.

Profile
 
 
Posted: 16 March 2011 01:49 PM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

If you can wait, I’m working on a fix. If you can’t wait, you can add this to the top of cartthrob/libraries/Data_sorter.php library above the class definition:

if (class_exists('Data_sorter')) return; 
Profile
 
 
Posted: 16 March 2011 01:58 PM   [ Ignore ]   [ # 5 ]
Is a Really Great Dancer
RankRank
Total Posts:  61
Joined  2010-12-03

I’ve added that line for now as the client needs to use the form to add content but I’ll keep an eye for an update.

Thanks!

Profile