Forum for discussing general topics related to Couch.
11 posts Page 1 of 2
Hello I got a new problem from Extended users, when I go into users/profile.php

I get this message ( ERROR: Tag "form" - page_id required ).

I using the pure php file I did download from CouchCMS:

Code: Select all
<?php require_once( '../couch/cms.php' ); ?>
    <cms:template title='User Profile' hidden='1' access_level="0"/>

    <!-- this is secured page. login first to access it -->
    <cms:if k_logged_out >
        <cms:redirect "<cms:login_link />" />
    </cms:if>

    <!-- someone who manages to reach here is certainly a logged-in user -->
    <h2>Edit profile</h2>

    <!-- are there any success messages to show from previous save? -->
    <cms:set success_msg="<cms:get_flash 'success_msg' />" />
    <cms:if success_msg >
        <h4>Profile updated.</h4>
    </cms:if>

    <!-- show the edit form -->
    <style>
        form{ width:400px; }
    </style>

    <!-- this ia regular databound-form -->
    <cms:form
        masterpage=k_user_template
        mode='edit'
        page_id=k_user_id
        enctype="multipart/form-data"
        method='post'
        anchor='0'
        >

        <cms:if k_success >
            <cms:db_persist_form />

            <cms:if k_success >
                <cms:set_flash name='success_msg' value='1' />
                <cms:redirect k_page_link />
            </cms:if>
        </cms:if>

        <cms:if k_error >
            <font color='red'><cms:each k_error ><cms:show item /><br /></cms:each></font>
        </cms:if>


        DisplayName:<br />
        <cms:input name='k_page_title' type='bound' /><br />

        E-mail:<br />
        <cms:input name='extended_user_email' type='bound' /><br />

        New Password: (If you would like to change the password type a new one. Otherwise leave this blank.)<br />
        <cms:input name='extended_user_password' type='bound' /><br />

        Repeat Password:<br />
        <cms:input name='extended_user_password_repeat' type='bound' /><br />

        <input type="submit" name="submit" value="Save"/>

    </cms:form>

    <!-- give an option to logout -->
    <a href="<cms:logout_link />">logout</a>

<?php COUCH::invoke(); ?>
That is quite strange as a logged-in user will always have 'k_user_id' set to her id.

To debug, please remove (or enclose within <cms:ignore>..</cms:ignore>) the form code and place a cms:dump_all as follows -
Code: Select all
<!-- someone who manages to reach here is certainly a logged-in user -->
<h2>Edit profile</h2>

<cms:dump_all />

Please verify that the variables show all proper info for the logged-in user (specifically k_user_template and k_user_id).

Let me know. Thanks.
KK wrote: That is quite strange as a logged-in user will always have 'k_user_id' set to her id.

To debug, please remove (or enclose within <cms:ignore>..</cms:ignore>) the form code and place a cms:dump_all as follows -
Code: Select all
<!-- someone who manages to reach here is certainly a logged-in user -->
<h2>Edit profile</h2>

<cms:dump_all />

Please verify that the variables show all proper info for the logged-in user (specifically k_user_template and k_user_id).

Let me know. Thanks.


I don't have any <cms:ignore> code in the profile.php, and I did try add the cms:dump_all command but nothing happend. I quess I doing something wrong. Hmmmm.
I think you misunderstood.
You need to do something like follows to comment out the form (else you'll keep getting the error)
Code: Select all
<!-- this ia regular databound-form -->
<cms:ignore>
    <cms:form
        masterpage=k_user_template
        mode='edit'
        page_id=k_user_id
        enctype="multipart/form-data"
        method='post'
        anchor='0'
        >
        ..
        ..
    </cms:form> 
</cms:ignore>

Now add the cms:dump_all and see what you get
KK wrote: I think you misunderstood.
You need to do something like follows to comment out the form (else you'll keep getting the error)
Code: Select all
<!-- this ia regular databound-form -->
<cms:ignore>
    <cms:form
        masterpage=k_user_template
        mode='edit'
        page_id=k_user_id
        enctype="multipart/form-data"
        method='post'
        anchor='0'
        >
        ..
        ..
    </cms:form> 
</cms:ignore>

Now add the cms:dump_all and see what you get



I got this:

Code: Select all
Edit profile

__ROOT__
k_user_id: -1
k_user_name: admin
k_user_title: admin
k_user_email: michel_schmidt@live.se
k_user_access_level: 10
k_user_disabled: 0
k_logged_in: 1
k_logout_link: http://localhost/users/login.php?act=logout&nonce=5db0df56ec43f71d839ea8c9ca760145&redirect=%2Fusers%2Fprofile.php
k_extended_user_id: 1
k_user_template: users/index.php
k_user_login_template: users/login.php
k_user_lost_password_template: users/lost-password.php
k_user_registration_template: users/register.php
k_cms_version: 1.4.5
k_cms_build: 20150722
k_admin_link: http://localhost/couch/
k_admin_page:
k_site_link: http://localhost/
k_admin_path: C:/wamp/www/couch/
k_site_path: C:/wamp/www/
k_template_title: User Profile
k_template_name: users/profile.php
k_template_id: 3215
k_template_is_clonable: 0
k_template_desc:
k_template_access_level: 0
k_template_is_commentable: 0
k_template_is_executable: 1
k_template_is_hidden: 1
k_template_order: 0
k_template_nested_pages: 0
k_template_gallery: 0
k_template_link: http://localhost/users/profile.php
k_prettyurls: 0
k_site_charset: utf-8
k_email_from: xxx@live.se
k_email_to: xxx@live.se
k_is_commentable: 0
k_is_list_page: 1
k_is_list: 0
k_is_page: 0
k_comments_count: 0
k_access_level: 0
k_page_date: 2015-10-15 16:21:43
k_page_creation_date: 2015-10-15 16:21:43
k_page_modification_date: 0000-00-00 00:00:00
k_page_draft_of: 0
k_page_id: 3404
k_page_link: http://localhost/users/profile.php
Thanks.

Could you please verify one point for me?

Check the cloned pages of the user template and see if a page exists for the admin?
I suspect there wouldn't be one. If so, go into the user panel (the original one at the bottom) and make some dummy changes to the admin account and save. This should create its associated cloned-page using the user template. Please verify this.

Let me know. Thanks.
KK wrote: Thanks.

Could you please verify one point for me?

Check the cloned pages of the user template and see if a page exists for the admin?
I suspect there wouldn't be one. If so, go into the user panel (the original one at the bottom) and make some dummy changes to the admin account and save. This should create its associated cloned-page using the user template. Please verify this.

Let me know. Thanks.



Ohh wow it's working! I did change on my main admin account, and is working now. Thanks so much!

Is it a bugg from the new couchcms patch? Or maybe just from me hehe.
Now all the accounts I register working with profile.php, so great! Now I can go the next level and try to make gavtar to it later :)
I'm glad :)

Is it a bugg from the new couchcms patch? Or maybe just from me hehe.
No it's not a bug. In fact it is mentioned in the docs -
You'll notice that the default user-account created by Couch at installation (the 'super-admin') does not, yet, have a counterpart cloned-page. Click on the account to open its edit screen and press 'save'. Doing so will create its associated cloned-page.

The reason is that the extended-users module will create an associated cloned-page for any account created/edited *after* it is activated. The default admin account comes into existence before the module was activated so it remains without its cloned-page. Explicitly editing it triggers the creation of the missing page.
KK wrote: I'm glad :)

Is it a bugg from the new couchcms patch? Or maybe just from me hehe.
No it's not a bug. In fact it is mentioned in the docs -
You'll notice that the default user-account created by Couch at installation (the 'super-admin') does not, yet, have a counterpart cloned-page. Click on the account to open its edit screen and press 'save'. Doing so will create its associated cloned-page.

The reason is that the extended-users module will create an associated cloned-page for any account created/edited *after* it is activated. The default admin account comes into existence before the module was activated so it remains without its cloned-page. Explicitly editing it triggers the creation of the missing page.


I now I see, but it's great to know that, when I upload my website in FTP I gonna know what too do next time :) Thanks! Again best CouchCMS.
11 posts Page 1 of 2