0

On my safecracker form I'm trying to allow each user to add 1 entry to be listed in a directory. I just created a new account, trying to test the form, but it has the values from the previous account for some reason. Heres the form

What did I do wrong?

1

You're using a lot of different calls in the form you provided. I'm not certain they are in the proper order. You're calling Solspace's User, then Channel Entries, then Membrr, then SafeCracker, like so…

{exp:user:edit return="member/profile"}

    {exp:channel:entries
    channel="personal_trainer_directory"
    limit="1"
    dynamic="no"
    }

    {if logged_in AND total_entries < 1}

    {exp:membrr:subscribed plan="1003"}

    {exp:safecracker
    channel="personal_trainer_directory"
    return="/member/profile"
    entry_id=""
    safecracker_head="no"
    use_live_url="no"
    url_title=""
    }

While other things could also be a factor, say 'cache', I'm wondering about your call order. Solspace's User:Edit form edits the currently logged in user, unless you are providing a member_id or username in the url. You didn't provide a sample url, but let's assume, it's something like:

http://mysite.com/directory/personal-trainers/joe-bob

That would work for providing 'User' with the identification it needs, but in your next statement…

{exp:channel:entries
    channel="personal_trainer_directory"
    limit="1"
    dynamic="no"
    }

you turn, dynamic processing off, which means channel:entries won't check the 3rd segment for unique identification data, but you aren't telling it what to use as a unique identifier: an entry_id, url_title, segment_4. So I'm not really certain what that statement is doing.

It seems as if you want it to count the number of records entered by the current or provided user, but as is, I think it will always provide NO records. Which technically, satisfies your next component…

{if logged_in AND total_entries < 1}

since 0 is less than 1. I think this may also be your culprit here, because unless you've set-up specific page error trapping, when 'no record' is found using channel:entries then the last record entered is displayed.

The other information, looks fine. But I think your problem is in the channel:entries statement:

{exp:channel:entries
        channel="personal_trainer_directory"
        limit="1"
        dynamic="no"
        }

You need to tell it what to check for, so it doesn't just return the last record.

0

If you are seeing previous form entries it could be caching - check this template isn't cached, clear the cache and try it again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.