After enabling this module and replacing the title for different content types, all titles of content is lost.

CommentFileSizeAuthor
#7 title-1146724-7.D0.patch4.34 KBplach
#4 title-1146724-4.patch4.39 KBplach

Comments

joostvdl’s picture

BTW. In the node table, the title is still saved. But the new fields are not prepopulated with the original title.

martin jinoch’s picture

Same problem here. Replacing Title for content-type works only if module Comment is enabled (as stated in http://drupal.org/node/1138646#comment-4429750 ) and after replacing Title all existing nodes of that content-type have blank Title.

using Title module version 7.x-1.x-dev 2011-May-09

dropcube’s picture

I confirm the issue, after replacing the title in a content type, nodes are showed with a blank title in any views and in /admin/content

I am using the latest -dev versions of entity, entity_translations and title.

plach’s picture

Title: Titles disapear after adding this module and replace title » Replacing field values are not initialized
Status: Active » Needs review
StatusFileSize
new4.39 KB

The attached patch should fix the issue.

martin jinoch’s picture

I've tried the patch and it now works just fine. Thanks

Scott J’s picture

Yes! Now this module is usable.

plach’s picture

StatusFileSize
new4.34 KB

The previous patch was failing tests badly (tests are reliable if run locally) and didn't work with taxonomy. The attached patch is all green.

das-peter’s picture

Latest patch worked in my manual tests like a charm :) Thanks plach!

plach’s picture

Title: Replacing field values are not initialized » Replacing field values are not always initialized
Priority: Major » Normal

Committed #7 to HEAD.

Changing to needs work since it seems we have still some problem with content created in language which has been uninstalled afterwards. We are missing tests too.

plach’s picture

Status: Needs review » Needs work
renat’s picture

Hi!
Latest -dev version converts node titles to fields very well for me, but the problem with taxonomy terms still exists. When I convert its "Names", they are still shown on the term page, but on "Edit" page "Name" field is empty.

Jerome F’s picture

Subscribe - I come from this duplicate issue http://drupal.org/node/1183524

When a term is created with the taxonomy term reference field's Autocomplete term widget (tagging), the title module's term name field is not completed, it's left empty, but the taxonomy term is saved.

Taxonomy term names are not filled, in case you add term programmatically, be it tagging, import from CSV file, or simple legacy Title conversion to field.

ptaff’s picture

Subscribing; same problem as #11.

internetdevels’s picture

Patch which fix this issue you can find here

13rac1’s picture

Status: Needs work » Active

My project has existing taxonomy terms with descriptions. The site is all in English, but Spanish has been recently added. I can reproduce this issue with the current(9/15/12) versions of all related modules.

Steps to reproduce:

  • Enable ET and Title
  • Don't enable translations for Taxonomy Terms in ET.
  • Replace the descriptions fields.
  • The descriptions are missing.

If I import a database backup, and enable translations for Taxonomy Terms the descriptions are imported into the new fields correctly.

ar-jan’s picture

Given #9 I thought this should work, but this doesn't work with node title fields for me:

- Install Drupal 7.17
- Create an article node
- Install and enable title 1.0-alpha4
- Edit content type Article and click the replace link for the title (message: "title replaced with a field instance.")
- Visit node/1 or the content overview, node 1 has no title in field_title.

dddave’s picture

Wasn't working for me neither. Had to disable the module and got my titles back. Found this in the watchdog:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'fid' cannot be null: INSERT INTO {file_usage} (fid, module, type, id, count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => media [:db_insert_placeholder_2] => node [:db_insert_placeholder_3] => 23 [:db_insert_placeholder_4] => 1 ) in file_usage_add() (Zeile 661 von /is/htdocs/XXXXXXXXXXXXXX/www/drupal/includes/file.inc).

muschpusch’s picture

dddave’s picture

Uh, thanks for the heads-up @muschpusch

tondeuse’s picture

I have gone through the same process here : launching a feature on a production site with content already present in various content types. The feature contained updates and declared the title as a title field for each of my content types. The node titles are gone altogether after the revert. A manual way to restore them is to follow the processed outlined below :

  1. Delete the title field
  2. Replace the title field again & confirm
  3. Revert the feature anew

Operation #2 invokes the internal method of the title module responsible for the migration of the title data from the node table to the title field table in the database. Operation #3 makes sure to restore the display & input settings for the tiltle field as you have designed them for each of your content types, as outlined in the code of your feature. Hope this helps some of you.

iztok’s picture

Issue summary: View changes

@tondeuse

I tried that but my titles are empty even after removing the field.

wizonesolutions’s picture

I'm encountering this on a fairly fresh Drupal 7.27 site using Content Translation (not Entity Translation). I'm using Title just to be able to move around the title field in custom view modes.

When I click replace, everything seems to go alright, but the initialization of the field values doesn't actually work. Titles render blank. When I delete the field, the titles come back (so it's not deleting the originals or anything).

I can also go in and set a title manually, and obviously things work alright then.

I'm not seeing any errors in the logs to go off.

I decided to put in some breakpoints and step through what is happening.

Everything looks good up through title_field_text_sync_set(). I even see $entity->title_field['en'][0]['value'] get set to the legacy title property.

Something happens between then and the final result being delivered to title_field_replace_init(). It becomes an empty array. So clearly something is altering it. I probably don't have time to provide a patch but want to try to contribute a root cause analysis at least :)

wizonesolutions’s picture

It's fixed in -dev. Can we get an alpha8?

pcorbett’s picture

Using 7x-1.x-dev. This works except that some title showed as blank for me when viewing on /admin/content. Clearing site caches fixed this for me. My guess is specifically, cache_page needed to be cleared. Hope this helps someone!

  • Commit 8516350 on 7.x-1.x, workbench by plach:
    Issue #1146724 by plach | das-peter, joostvdl: Fixed Replacing field...
deivamagalhaes’s picture

Is this already committed to alpha8?

pol’s picture

Status: Active » Fixed

Yes

Status: Fixed » Closed (fixed)

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