31 Posts
Catastrophix
7 years ago
5
Topic

Hello,

I have one user content type with many forms that I want to use to update that content type. I'm using the user bridge so therefore have the user table associated with the content type table all managed by SEBLOD. Please confirm my logic:

  1. Create main user content type with fields (lets call it 'user_directory')
  2. Create update user content types (e.g. 'region') with field (e.g 'update region') storage set to standard > free > cck_storage_form_user_directory and the 'region' field in that table
  3. Add 'art-created-by' field to update content type and live value of this field must be user 'id' to make sure logged in user updates his/her own record via the update form
  4. Set each of the live configuration for the update fields ('update region') fields to be user and with property 'region' to match the field i want updated in the main 'user_directory' content type table

Over the last 50 hours (now becoming livelihood-threatening) I have lurched between things working perfectly and things falling apart. I finally found the data integrity check setting to disable checking which solved many of my problems, but I still get "Duplicate entry '0' for key 'PRIMARY' SQL=INSERT INTO...." errors which are somewhat eratic. E.g recreating content types with the same logic works evoking the happy dance and then things fall apart causing great despair.

Some basic questions I need to verify:

  1. Must the object types of the update content types be user or article object types?
  2. Is the standard > free > cck_storage_form_user_directory and the 'region' field correct?
  3. Why when I change the above from free to standard > article does SEBLOD seem to have memory of a particular table and field ('region' in this example)? Surely when changing from free to standard, there should be no reference of the table and field?

Get a VIP membership
4229 Posts
Kadministrator
7 years ago
0
Level 1

You can't mix mutiple storage objects in the same content type, you need to use whatever your content type is using - with user content type you can only use user object. Only way tto do whyt you would like to do is to manually update other content types in beforeStore or afterStore code field.

98 Posts
Edwin
7 years ago
3
Level 1

Hi Sebloders
I am looking for something similar. The user registers using one content type (Form1). But there are fields I want the user to submit after they are logged in, from a different content type (Form2). When I create another user content type with the extra fields, I get this on submission: "Error, name required". Etc. I tried using CodeBeforeStore or CodeAfterStore but a new user is created in database even though the user submitting Form2 is already registered and looged in.

Thanx in advance

Edwin

4229 Posts
Kadministrator
7 years ago
0
Level 2

YOu cna load existing use in code. Otherwise just use one form with different conditional and restrictions, e.g.  put Workflow->Add restriction on fields from form1 and Edit restriction on field from form2 - this way it will look as a different from to the user.

31 Posts
Catastrophix
7 years ago
1
Level 2

Hi Edwin. After spending quite a few days of my life on this, I finally resorted to separate content types with SEBLOD storage fields set to "none" and then using BeforStore code to deal with the mySQL updates by brute force. Storage-Format/Object-user bridge is one area that I find extremely poorly documented (or perhaps it is just me :( ).

If I remember correctly, try not to mix storage (user/article) and pay attention to the dropdown settings of the content type (blue arrow at top of content type config page) >> "User" for your user creation form and "Article" for your subsequent update form/s.

Additional user edit form/s (of the "Article" object type) linked to currently logged in user via Live plugin. Select "user" for each field and set "Property*" in the "Configure" settings to the appropriate database column for each.

On a related note, with a recent 3.11.xx update, it seems I am now not able to follow my former approach in defining database tables and mySQL database fields when adding a new SEBLOD field to my user content type. I am forced now to use SEBLOD's user table.

EDIT: Please ignore above. My error. New user field creation works as before. Apologies.

98 Posts
Edwin
7 years ago
0
Level 3

Hi Catastrophix

Thanx for your input. I have been away for a while and couldn't reply sooner. I will look into your suggestions and see if I can make it work. Kind regards

Ed

Get a Book for SEBLOD