Hi, great module...I've managed to get a subform showing up in one of my content types (CCK). I expand one of the collapsible fields and check off a number of items and hit SAVE. Page refreshes and the boxes are unchecked. I go to the view and none of the data is listed. Doesn't look like checking them actually does anything. Any ideas? I took a look at the demo site and it looks like the same thing is happening there.

CommentFileSizeAuthor
#10 revver_3.gif15.92 KBlunas
#5 queries.txt27.52 KBlunas

Comments

lunas’s picture

I should add that I implemented the bug fix listed in the issue cue regarding the drupal_add_js paths. Didn't help.

ericg’s picture

it sounds like the .js files are not loading

where is the module located (in the main modules directory or a subdir of sites?

lunas’s picture

The main modules directory. I've checked the page source and the paths to the js files are correct. Not getting any js errors in the status bar.

ericg’s picture

just for control, can you change back to the unpatched/unedited 0.30 code? this way we can both have the same code running so I can try to replicate and help you out?

put the module in main modules dir and see what happens.

also, if you can install the devel module so we can see what queries are being executed that will help.

lunas’s picture

StatusFileSize
new27.52 KB

Thanks for the help. I've gone back to the original code. The module is in the main modules folder. Attached are the queries generated by devel.module. Here is the relevant code in the view source page concerning the paths/css/js files. They look fine to me, even without that previous patch...

@import "/boxing/modules/subform/subform.css";@import "/boxing/modules/subform/subform.css";
lunas’s picture

I forgot the code tags...

<style type="text/css" media="all">@import "/boxing/modules/subform/subform.css";</style>
<script type="text/javascript" src="/boxing/modules/subform/subform.js"></script>
<style type="text/css" media="all">@import "/boxing/modules/subform/subform.css";</style>
<script type="text/javascript" src="/boxing/modules/subform/persistent_fieldset.js"></script>
ericg’s picture

it all looks right, but there is no insert to the db happening.

if you try to navigate directly to the .js can you get the file (i'm wondering if it is a server issue/file permissions issue)

try http:// your url//boxing/modules/subform/subform.js

lunas’s picture

Yep, works fine. Browser downloads the script.

ericg’s picture

Title: Checkboxes will not stay selected, data not saved » Checkboxes will not stay selected, data not saved
Status: Active » Closed (duplicate)

ok.

my guess now is that your issue is related to this one http://drupal.org/node/104305

(i'm going to mark this issue as a duplicate for now)

lunas’s picture

StatusFileSize
new15.92 KB

Some more info...I found it is actually writing to the database, but only when I hit "SUBMIT" like the regular node editing screen. If I hit SAVE under any of the subform fields then nothing happens. Now, this also causes some other problems.

I currently have two subforms on the page, one subform for Abs and one for Chest. Each with a couple of exercises users are able to select (hence the reason for the subform.) When I click an exercise in Chest and hit submit (not save), it is written to the database and the box remains checked, but it lists the chest exercise under both abs and chest and if I attempt to edit it anymore, the browser hangs -- I've written this a couple of times now :)

At any rate, it seems the SAVE button is what is causing the changes to not be saved. I suspect the inclusion of the exercises in the wrong spots/browser hanging may be other problems?? I'm going to eliminate one of the subforms for now and see if one subform on the page behaves properly.

I've attached a screenshot for the mixup problem.

ericg’s picture

Status: Closed (duplicate) » Active

I think this is because you are linking to the same node type with two relationships.

I'll try to replicate this later, I've made the issue active again. Hopefully MrTaco has some ideas, but I think this will be very complex to fix.

My suggestion for the short term is to not try to relate one node type in two different ways to a single node type.

ericg’s picture

how many relationship types do you have setup?

are you using the same relationship type to define both subform fields?

lunas’s picture

The answer is Yes. I have one relationship setup -- a Workout to Exercise Relationship. Nodes of type workout are able to incorporate any number of nodes Exercise and vice versa. Nodes of type exercise can be related to any number of workouts. Both have their cardinalities set as 999999 in the creation form. Should I not be doing this?

ericg’s picture

this might be the root of the issue

define two relationship types, one for chest exercises one for abdominal (they can basically be duplicates of each other)

the way the data works is that it stores relationship type id; node id; node id

so you have to have two relationships to relate the same nodes to a node type twice

lunas’s picture

Okay, I completely eliminated all subform fields from my content type. I eliminated all of the tables in the database, deactivated and deleted the module. Then I spend about an hour trying to reinstall it -- long story short, it doesn't work well with the devel module when you have query logging enabled -- continuously caused the browser to hang. Once I got it reinstalled - fresh slate, I created a relationship type of Workout to Abs - cardinalities of 999999 for both nodes workout and nodes Exercises. (I need all nodes of type exercise to be able to access all nodes of type workout and vice versa)

Now I went ahead and put a subform into my workout content type and tried to add a workout. Everything displays correctly. I can check off an exercise and if I hit SUBMIT, everything updates correctly. If I hit SAVE - nothing happens. If I then try to delete the exercise from the workout (uncheck the box) and hit SUBMIT, I get the following errors, but upon refreshing the page, it is updated correctly - so that part almost works. Again SAVE does nothing.

Here are the errors:

Warning: Duplicate entry '2604-0' for key 1 query: INSERT INTO node_data_field_equipment_required (field_equipment_required_value, vid, nid, delta) VALUES ('', 2604, 2603, 0) in /home/howtobox/public_html/boxing/includes/database.mysql.inc on line 121

Warning: Cannot modify header information - headers already sent by (output started at /home/howtobox/public_html/boxing/includes/database.mysql.inc:121) in /home/howtobox/public_html/boxing/includes/common.inc on line 269 

Field equipment required as mentioned in the error is a multiple select field (based on taxonomy)- it has nothing to do with subform. But without subform enabled, it works fine.

Next I added in another subform - Chest after creating a new relation type for Workouts Chest - as you said a duplicate. It behaved exactly the same way.

So, all in all, it is working except for the error above and the fact that the SAVE button doesn't work. Hope that helps narrow it down...

liquidcms’s picture

i was havng same issue of not being able to save info in subform.

then i moved the subform module folder to the main modules folder and it seemed to work - originally i had it in the cck module folder (which is where all my cck related modules go)

also, not sure this will quite do what i need - since field group permisssions don't seem to exist for cck i thought this might help out... but not sure it can help me.. i iwll do seperate post for "support" question

casey’s picture

Title: Checkboxes will not stay selected, data not saved » Checkboxes will not stay selected, data not saved
Status: Active » Closed (fixed)