ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Getting a database error after logging in via front-end

June 07, 2011 9:35am

Subscribe [4]
  • #1 / Jun 07, 2011 9:35am

    SF9

    18 posts

    I’m getting the following error when logging in via a front-end log in form:

    {exp:member:login_form return="/"}
        <fieldset>
            <div class="form-element clearfix">
                <label>Username: <span class="required">*</span></label>
                <input type="text" id="sign-in-username" name="username" value="" class="text required" />
            </div>    
            <div class="form-element clearfix">
                <label>Password: <span class="required">*</span></label>
                <input type="password" id="sign-in-password" name="password" value="" class="text required" />
            </div>
            <div class="form-element clearfix">
                <input type="submit" id="sign-in-submit" name="submit" value="Submit" />
            </div>
            <div class="form-element clearfix meta">
                <a href="/members/forgot">Forgot Sign In Details?</a> | <a href="/members/sign-up">Not Signed Up Yet?</a>
            </div>
        </fieldset>
    {/exp:member:login_form}
    A Database Error Occurred
    Error Number: 1054
    
    Unknown column 'exp_channels.site_id' in 'where clause'
    
    SELECT * FROM (`exp_fieldtypes`) WHERE `exp_channels`.`site_id` = '1' LIMIT 1
    
    Filename: libraries/Addons.php
    
    Line Number: 265

    I would assume that its one of the fieldtypes is causing the problem here but I’m not sure how to tell which one.

    Can anyone help?

  • #2 / Jun 07, 2011 12:45pm

    Sue Crocker

    26054 posts

    Hi, SF9. Unfortunately I have no idea, you’d need to disable them one by one until you find out which one it is. Chances are it was one you added recently.

  • #3 / Jun 08, 2011 6:29am

    SF9

    18 posts

    I’ve disabled every field type and it still isn’t working, any chance this could be passed on to a dev?

  • #4 / Jun 08, 2011 9:55am

    SF9

    18 posts

    Okay, I’ve start digging into this a bit more, I have this form on a template with a safecracker form and it looks like the safecracker form is putting its hidden fields into the login form, one of the parameters in the {exp:safecracker} form tag is site_id so that’s where that coming from. In order to workaround this issue, I’m redirecting to another template to log in but this seems a bit silly. It could be a bug :0

  • #5 / Jun 08, 2011 10:00am

    Sue Crocker

    26054 posts

    Can you post your SafeCracker form so we can attempt to replicate it? I have a newer build with a few bug fixes to SafeCracker I can test against.

  • #6 / Jun 08, 2011 11:00am

    SF9

    18 posts

    Okay, thanks. Here you go:

    {exp:safecracker
        site_id = "1" 
        channel="discussions" 
        return="/lets-talk/created/ENTRY_ID" 
        include_jquery="no" 
        error_handling="inline" 
        rules:categories="required"}
        
        <div class="form-element clear">
            <label for="title">Title: <span class="req">*</span></label>
            <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100">
            <input type="hidden" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50" />
        </div>
        <div class="form-element clear">
            {category_menu}
            <label for="categories">Category: <span class="req">*</span></label>
            <select name="category[]" id="categories">
                {select_options}
            </select>
            {/category_menu}
        </div>
        <div class="form-element clear">
            <label for="discussions_post">Post: <span class="req">*</span></label>
            <textarea name="discussions_post" id="discussions_post" rows="15" cols="50">{discussions_post}</textarea>
        </div>
        <div class="form-element clear-bottom clear">
            <input type="submit" name="submit" class="submit" value="Submit" />
        </div>
    {/exp:safecracker}
  • #7 / Jun 08, 2011 4:37pm

    Brandon Jones

    5500 posts

    Hi SF9,

    I don’t believe site_id is a valid parameter. Try site=“your_site_name”, where your_site_name is the short name of the site.

  • #8 / Jun 09, 2011 12:21pm

    SF9

    18 posts

    I’ve tried using site=“mysitename” and I’ve tried it without specifying the site and I get the same database error each time. The hidden fields for the safecracker form are being copied into the login form.

    <div class="hiddenFields">
        <input type="hidden" value="3918e2010aaa8c34b8df7b7d5718d440c9b904ef" name="XID">
        <input type="hidden" value="60" name="ACT">
        <input type="hidden" value="/members/account" name="RET">
        <input type="hidden" value="1" name="site_id">
        <input type="hidden" value="/lets-talk/created/ENTRY_ID" name="return">
        <input type="hidden" value="inline" name="error_handling">
        <input type="hidden" value="n" name="allow_comments">
        <input type="hidden" value="sifshgtlVpAph/tZyr31tW+f/Qw5L2bLjCjkQeiPegk=" name="rules[categories]">
    </div>
  • #9 / Jun 09, 2011 5:55pm

    Brandon Jones

    5500 posts

    SF9,

    What version and build are you on? I can’t reproduce this on my development build, so perhaps this is already fixed. Here’s the template I’m trying with:

    {exp:safecracker
        site_id="1"
        channel="news" 
        return="/news" 
        include_jquery="no" 
        error_handling="inline"}
        
        <div class="form-element clear">
            <label for="title">Title: <span class="req">*</span></label>
            <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100">
            <input type="hidden" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50" />
        </div>
        <div class="form-element clear">
            <label for="discussions_post">Post: <span class="req">*</span></label>
            <textarea name="discussions_post" id="discussions_post" rows="15" cols="50">{discussions_post}</textarea>
        </div>
        <div class="form-element clear-bottom clear">
            <input type="submit" name="submit" class="submit" value="Submit" />
        </div>
    {/exp:safecracker} 
    
    {exp:member:login_form return="/"}
        <fieldset>
            <div class="form-element clearfix">
                <label>Username: <span class="required">*</span></label>
                <input type="text" id="sign-in-username" name="username" value="" class="text required" />
            </div>    
            <div class="form-element clearfix">
                <label>Password: <span class="required">*</span></label>
                <input type="password" id="sign-in-password" name="password" value="" class="text required" />
            </div>
            <div class="form-element clearfix">
                <input type="submit" id="sign-in-submit" name="submit" value="Submit" />
            </div>
            <div class="form-element clearfix meta">
                <a href="/members/forgot">Forgot Sign In Details?</a> | <a href="/members/sign-up">Not Signed Up Yet?</a>
            </div>
        </fieldset>
    {/exp:member:login_form}

    Both the login form and the Safecracker form work properly for me.

  • #10 / Jun 14, 2011 5:54pm

    SF9

    18 posts

    Hi Brandon, sorry for the delay.

    Version: 2.1.3
    Build: 20101220

  • #11 / Jun 15, 2011 3:22pm

    Brandon Jones

    5500 posts

    OK, that’s an older build so I’m assuming this has been fixed. I’d suggest upgrading to 2.2 when it’s released next week, and will keep this thread open in case you run into any other issues. Thanks!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases