While trying to write a module that uses some of the functions from content.module, I often found it extremely difficult to follow the code because there was little or no commenting and often absolutely no Doxygen-style documentation on the "minor" functions. Please, strongly consider going over all the functions-- no matter how minor they are-- and adding documentation.

Comments

raintonr’s picture

Version: 5.x-1.6 » 6.x-2.x-dev

+1 for this. And changing to 6.x as doco on the current version is what would be nice.

Sorry, but I have a 5.x CCK module and am completely lost on how to get my widget upgraded to 6.x. Specifically, the 5.x widget has several inputs inside which seems to make things tricky. Have read the 5-x -> 6.x upgrade page with little success:

http://drupal.org/node/191796

Can someone who knows how to go have a crack at updating some of the CCK documentation pages to be relevant to 6.x, or more likely, create a 6.x version pages like this:

http://drupal.org/node/106716

Would be much appreciated.

ztyx’s picture

Please, strongly consider going over all the functions-- no matter how minor they are-- and adding documentation.

If it helps, KarenS wrote that the Text and Number modules (in CCK bundle) are throughly documented. You might learn something looking at that piece of code, and maybe even transfer some of that knowledge into comments in the content.module..

raintonr’s picture

Good suggestion, but...

... have looked at the modules that come with CCK and tried my best to do the same thing.

Somehow though, the widget for my input is not appearing. No errors or anything, just no widget. Through debug message placed in there I know the function specified in the #process field returned from the hook_elements is being called. Rather frustrating :(

ztyx’s picture

It is very funny you mention this. I experienced the exact same thing a minute before I read this. Spooky!

I am learning CCK, too, and I'm trying to upgrade Money CCK field to CCK 6.x. If I fix this I will send you my solution.

ztyx’s picture

Somehow though, the widget for my input is not appearing. No errors or anything, just no widget. Through debug message placed in there I know the function specified in the #process field returned from the hook_elements is being called.

Hmm, have you implemented the corresponding theme function that needs to coexist for every element defined in hooks_elements()?

xano’s picture

I needed to find out some stuff about CCK hooks, but I was disappointed, because all there was, was a page with limited documentation on the hooks for CCK for Drupal 6.
1) Where has the documentation on CCK for Drupal 5 gone?
2) Why separate the documentation by Drupal version? It had better be separated by CCK version, since CCK 5.x-1.x and 6.x-1.x should have the same features, for instance.

I was looking for a way to manipulate a CCK field through a third module. I found hook_field(), but the documentation does not explain all parameters extensively enough. What do 'alter' and 'sanitize' do, for instance?

autopoietic’s picture

I found a good tutorial here:

http://www.poplarware.com/cckfieldmodule.html

its for a specific use case - which is why I found it, but it helped me understand the hooks (eg alter and sanitize Xano) and it is clearly labelled where you would depart from the method for other tasks.