This patch comes from Eaton. We've been using it for a few days with no signs of horror and trauma so hopefully others can use it as well. ;)

Comments

ray007’s picture

is there any plan to do a release for drupal 5 sometime soon?
would be a nice feature to have ...

moshe weitzman’s picture

I'd like this too. Any status report, Mark?

mfredrickson’s picture

I'll have time by Saturday (2/3). Hopefully before, if this patch is as clean as advertised. :-)

alex_b’s picture

Thanks for your great module. It really adds flexibility to the CCK/views pack. I use viewfield for circumventing views module's lacking support for multilingual header/footer texts.

This patch works fine with CCK 5.x-1.2 but not with the CCK 5.x dev version. The latest CCK version allows to chose which fields to show on teasers and which on full node views by an additional form ("Display fields") on the CCK content configuration pages. I can only chose for viewfield.

yched’s picture

I can only chose for viewfield
I guess this was "I can only chose <hidden> for viewfield" ?

That's strange because the version of viewfield.module this patch builds upon does define formatters, which should show up on the display settings overview form.
There is no 'default' formatter, though. I _think_ this is required, so maybe this is related.

Additionally, hook_field('view') is now handled by content.module unless explicitly specified.
Looking at the current implementation of viewfield_field('view'), it seems this default behaviour won't be right, so the module has to say it wants its 'view' callback executed.
You have to add something like

case 'callbacks':
      return array(
        'view' => CONTENT_CALLBACK_CUSTOM,
      );

in function viewfield_field_settings.
And the code for the 'view' op itself will have to be modified to use content_format with the formatter chosen by the user.
See field.php doc file for more info.

Note that all of this also applies to the 4.7 branch, BTW.

alex_b’s picture

StatusFileSize
new2.12 KB

yched,

Thanks for the hint. hook_field_settings() was the place where I had to add the changes you suggested.

The attached patch upgrades the current viewfield 4.7 branch to 5.x and the latest CCK version of the 5.x branch.

-alex

alex_b’s picture

StatusFileSize
new3.46 KB

I just got this patch from stefano73, it adds a pager to viewfields.

In lack of a Drupal 5 development branch I post a patch for the 4.7-dev branch, that upgrades viewfield 4.7 to 5.0, contains the hook_field_settings() fix from above and adds a pager to viewfields.

mfredrickson’s picture

@alex_b: thanks for getting that feature put together.

On a general note, can can keep the patches down to the topic at hand? It's hard to evaluate many, simultaneous changes. Feel free to open up more issues.

I'm going to get viewfield up to 5 now. I may ask for another patch for this feature. :-) Thanks.

mfredrickson’s picture

Status: Needs review » Fixed

Alright, we're at 5!

Release notes:

Viewfield for 5.0

Thanks to eaton, webchick, alex_b, yched, and stefano73 for helping get viewfield ready for Drupal 5.0.

This release is basically a compatibility release. Some changes to the implementation:
1. More reliance on the views formatters (as seems to be the norm for CCK fields now) for formatting regular node views.
2. The full node formatter is now the "default". This may break some existing views. It's worth the pain.
3. Added paging as per stefano73/alex_b's work. Relatively untested, but it looks good so far. (Thanks!)

Watch http://drupal.org/node/100971 for further updates on viewfield's future.

alex_b’s picture

Status: Fixed » Active

The latest version in the 5.x branch is not 4.7.x + the patch from #7 in this queue.

Is there a particular reason that not all of the patch went into 5.x?

What parts are missing?

I will try to put the puzzle together, but will wait for your heads up before I start.

alex_b’s picture

Title: Port Viewfield to 5.x » Get in rest of pre 5 branch patches into 5.x
alex_b’s picture

Title: Get in rest of pre 5 branch patches into 5.x » Port to 5.x / get in rest of pre 5 branch patches into 5.x

better :)

mfredrickson’s picture

Status: Active » Fixed

I believe you are incorrect. The paging was included in this patch. Please see:

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/viewfield/vie...

Are there other features/fixes missing? If so, please open an issue for each one.

Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)