lnid not available in presave hook

stoinov - December 20, 2008 - 18:07
Project:Type-local nids
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:jbrown
Status:postponed
Description

I currently use http://drupal.org/project/auto_nodetitle for the titles of my content types. And when I tried to use [lnid] nothing happens.
I tried the weight reduction (and increasing) for the module but it didn't help. It doesn't update the title even if I repost the content.
The only workaround that I found is to create Compute field and assign the [lnid] value to it, and then to use that field in the auto nodetitles. And even then this is not working in the first post, but I have to repost in order to update the correct title.

Is there a possibility to add that functionality - using [lnid] with auto nodetitle?

#1

wibe - March 6, 2009 - 18:58

I believe you could do this as follows: 1) Create a CCK field to hold the lnid (see #313476: Problem with CCK computed field). Then, 2) in Automatic Nodetitles, look for the replacement pattern of the field you just created and used at will.

#2

HoKe - April 19, 2009 - 22:33

Hi,
can you please explain how to create a cck field to hold the lnid?

should I use the computed Type of data or something else to store it?
what whould be then writen in computed code text area?
thx in advance

#3

jbrown - April 25, 2009 - 20:31
Title:Using lnid in Title» lnid not available in presave hook
Category:feature request» bug report
Assigned to:Anonymous» jbrown
Status:active» postponed

auto_nodetitle uses the presave hook so it can generate the title before the node is saved - the lnid is not available at this time

type_local_nids uses insert / update as it needs the nid for the key in its {node_lnid}

the lnid could be generated in presave to fix this

I am available for hire if anyone wants this fixed.

 
 

Drupal is a registered trademark of Dries Buytaert.