Remove and re-add CCK fields on variant
drupallogic - September 27, 2009 - 21:43
| Project: | Advanced Profile Kit |
| Version: | 6.x-1.0-beta2 |
| Component: | CTools integration |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | fixed |
Jump to:
Description
There is an error when I use advanced_profile. I looked around drupal.org and found it's a legend error. though I see in when I enable advaced_profile.
warning: preg_match() expects parameter 2 to be string, array given in /home/x/public_html/x/includes/bootstrap.inc on line 777.
Beside this, there are problem with the parts like about me. others as well. there is no "filed formatter" so you can't change for ex. title of the pane.
warning: Invalid argument supplied for foreach() in /home/x/public_html/x/sites/all/modules/cck/includes/panels/content_types/content_field.inc on line 166.

#1
Have you checked that you use the recommended versions of all modules APK needs (see the Release notes)?
I suspect that his is caused by using "old" versions of cck or views. I tested the module with the recommended settings and noticed nothing but on my current instal I stupidly didn't use the recommended versions....god knows why. :(
I have the second problem about the "Field Formatter". The field on the pane's settings screen is empty and there is nothing to choose in the dropdown. I also get an error message "Invalid argument.......on line 166".
I stumbled upon this problem because I investigated why the empty field was displayed on profile pages. Other fields without content aren't displayed but this field renders as an empty box.
I updated all modules to the versions recommended in the Release Notes, flushed caches, croned, disabled and reenabled modules and reverted the variant but the error still exists.
#2
These errors you are getting are in CCK's CTools/Panels integration so I'm moving it there. I know the maintainers don't have time for the integration so I will try and follow up on this myself. It might be a few days, though, as I have a lot going on. If you don't see anything from me by the end of the week, and no one else answers, give it a bump. I might forget it if it's not in my queue.
Michelle
#3
We already have another issue about this: #589306: warning: Invalid argument supplied for foreach() in includes/panels/content_types/content_field.inc on line 166
But I'm starting to believe in gremlins.
#4
Ah, sorry, I didn't check for dupes before moving it. I didn't realize this was a known issue. I'll still try to follow up on this... Though I'm running APK on multiple sites with no issue so it's hard for me to debug. But I'll see what I can do.
Michelle
#5
I'm using latest modules. so it's not the case.
as I'm getting errors, I created my own profile page without using APK but just it's views.
Though I'm missing "last profile visitors" part. I wish I could add it without using APK.
What I think is the errors come due to profile content part of APK. if it was not connected directly, should be better I assume.
thanks for the module anyway.
#6
That really doesn't make sense. APK's profile page variant is simply an exported variant. It's not doing anything special. I just put it together in the UI of CTools and exported it. So if CTools is working there's no reason why APK wouldn't be.
Anyway, let's follow this on the other issue as this one has been marked duplicate.
Michelle
#7
@Michelle: I just checked APK, and it seems that 'uprofile:field_xxx' comes from the file
advanced_profile.pages_default.inc.It seems that this default panel page was generated using the old naming convention ?
#8
<?php- $pane->subtype = 'uprofile:field_about_me';
+ $pane->subtype = 'field_about_me';
?>
<?php- $pane->subtype = 'uprofile:field_interests';
+ $pane->subtype = 'field_interests';
?>
¿?
#9
That file was last generated 11 days ago. Unless CCK has changed since then, that points to a problem in the exporter. I don't write that code manually; I use the export functions in CTools.
Michelle
#10
Is it possible that the export was generated from a panel that was created with old names?
#11
Well, the variant was originally created a long time ago, yes, but I assumed fresh exports would write the export file in the current way. I don't really know how the exporter works. I would hope I wouldn't have to delete my variant and completely redo it from scratch any time there's changes to CCK's integration. And I'm not having any of these errors on my sites, either.
Michelle
#12
@Michelle: the old names for CCK fields exposed to Panels had to be changed because fields can be shared between several node types. Otherwise, we would had a CTools content type for each field in each node type it is being shared, making it more difficult to build panels that are going to be used for several node types. This is something that we had to do.
Well, those lines I posted in #8 do not reflect the current naming convention, so I think it would be nice to fix that in APK package. It's a way to stop propagating something that is not correct.
For this reason, and because we already have another issue in the CCK queue, I'm transferring this issue to APK. Then you're up to decide what to do with the default CTools panel.
To fix existing panels, those created with the previous version of CCK integration in Panels, I think it can be done removing those 2 fields, and then re-adding them back manually. The new version of those fields will have the new name.
I think we all forgot to amend the subtype for the content type settings form. Reference: #505278: Panels 3 and multiple node type fields.. Hence, I'll also apply the patch I posted in the CCK issue #589306: warning: Invalid argument supplied for foreach() in includes/panels/content_types/content_field.inc on line 166 as soon as someone can confirm it fixes something.
#13
Ok, I'll give that a shot. If it doesn't work, I'll rebuild the variant from scratch but I'll wait until I go to RC before I do that in case there's any other changes. It's not terribly hard to build a variant but it's not something I want to do repeatedly.
Michelle
#14
I changed this in the exported code and it looks like it stuck. I can confirm the uprofile: is no longer on the fields. I can't confirm that fixed the original problem as I was never able to repro it.
Michelle
#15
Automatically closed -- issue fixed for 2 weeks with no activity.
#16
Hi,
Im having the same problem, since i installed apk beta 2.
I have installed the lastest versions of each module required by apk.
warning: preg_match() expects parameter 2 to be string, array given in /home/x/public_html/x/includes/bootstrap.inc on line 777.
Regards,
#17
Beta 2 was released on September 16th. This was marked fixed on September 29th.
Michelle