They don't display. Worked fine before I upgraded to dev version.

CommentFileSizeAuthor
#17 cck-blocks_fieldsets-6-HEAD_648878.patch1.66 KBAnonymous (not verified)
#12 cck_blocks.zip1.42 KBAnonymous (not verified)
#4 cck_blocks_patch.txt2.24 KBrogerpfaff

Comments

rogerpfaff’s picture

subscribe

I installed CCk blocks new with drush. I have installed the 1.2-RC1

Anonymous’s picture

Thanks for the report. I will have a look at that as soon as possible. Unfortunately, that could last until the second half of January. It would be very helpful, if someone could figure out, where the bug is related in the code.

rogerpfaff’s picture

the problem as I see it is based in the wrong addressing of fields.

When we check $built_nodes[$nid]->content[$delta] $delta is a field name like field_mysomething but the the field we are looking for is under content['group_mysomething']['group'][field_images']. So we can't get the contents of the field.

So far my findings.

rogerpfaff’s picture

Version: 6.x-1.x-dev » 6.x-1.2-rc1
Status: Active » Needs review
StatusFileSize
new2.24 KB

ok, here is a patch for the issue.

Anonymous’s picture

Status: Needs review » Needs work

Roger, thank you for your support. I'm able to reproduce this issue, but unfortunately, your patch doesn't solve it. Block is still not displayed if the field is in a field group.

Anonymous’s picture

fr33dom provided a solution at #656908: CCK fields that are within a CCK group do not work for CCK blocks that works for me. Maybe that helps figuring out the problem in your patch.

rogerpfaff’s picture

I'm not sure but from a fast review his patch renders the complete fields of the fieldset in the block. my approach was only for single fields selected as block. but as said it's just by looking for 2 minutes at the patch. if the other one solves the problem better commit it. :)

Anonymous’s picture

Do you have any idea, why your solution doesn't work in my installation? I guess, it works for you :-)

rogerpfaff’s picture

Now... I don't know your installation. ;)

Do you have only the fields exposed in the blocks menu or do you perhaps see complete fieldsets to choose from?

In my installation I see only fields and no fieldsets. Do you have any exclusion settings in the 'display fields' tab on content type configuration?

Anonymous’s picture

I can select fields included in a fieldset as well as fields, that are not in the fieldset. There is no difference in the block selection. I have no exclusion in the display settings of the field. The field, I tried your code with, shows up if it is not included in the group. If I put it in a group, it does not show up.

EDIT: there is no field displayed as block with your code on my installation :-(

rogerpfaff’s picture

This is really strange. Do you have this code block in your cck_block.module file:

        elseif (isset($fields[$delta]['display_settings']['parent']) && isset($built_nodes[$nid]->content[$fields[$delta]['display_settings']['parent']]['group'][$delta])) {
          // evaluate tokens, if token module is installed
          if (module_exists('token')) {
            $block['title'] = _cck_blocks_evaluate_token($delta, $node);
          }          
          $block['subject'] = t($fields[$delta]['widget']['label'] ? $fields[$delta]['widget']['label'] : $delta);
          $block['content'] = drupal_render($built_nodes[$nid]->content[$fields[$delta]['display_settings']['parent']]['group'][$delta]);
        }
Anonymous’s picture

StatusFileSize
new1.42 KB

Yes, I have this block. I just integrated your patch in the latest version, using cvs diff. Should now be no difference between my file and yours. Have a look at the attachment, if you like.

rogerpfaff’s picture

do you have any messages in the log files? What kind of fields do you use?

Anonymous’s picture

There's nothing in the log and I tried "Node reference" fields as well as "text" fields.

rogerpfaff’s picture

ok. let's try this: insert a print_r($fields) on line 88 and call a node where the fields you wish to show are included and then check the field array for the following cascade: field_name[display_settings][parent][group]

If yes check with the devel module on tab 'dev render' if you have the groupname from this field in the content array where the path should be content[group_name][group][field_name]. This is the object I render in my code.

Anonymous’s picture

thanks for taht hint. I can find field_name[display_settings][parent], but it's empty, even if the field is in a group. The problem is, thtat field_name[display_settings][parent] seemst do be set, but contains no data (its an empty string).

I can fix the problem for fields, that are not in a group, by modifying the first statement to what is was without your change. That's no problem, as it doesn't evalueate to true if the field is in a group.

More important is the second statement. That evaluates to true, as the empty string for [parent] is set, but it does not work, as ther is no information, to get out of that empty string. I did a diff for the complete fields array and it seems that it doesn't change when moving a field into or out of a group.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new1.66 KB

Is I have no idea, how to fix the problem with the parent, I created a patch, using the second solution, cycling through the whole content data array. There might be better solutions with better performance, but for now, that solves the problem.

rogerpfaff’s picture

seems to work for me too. I'm ok with it.

Anonymous’s picture

Status: Needs review » Fixed

Committed to -dev

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.