myexperiment-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Myexperiment-discuss] Content-type title error?


From: Don Cruickshank
Subject: RE: [Myexperiment-discuss] Content-type title error?
Date: Sun, 26 Apr 2009 22:55:37 +0100

Hi Tony,

 

Second point first – it’s expected that you won’t see a reference to ‘title’ in the migration when it runs, since it’s a part of the “create_table(:content_types)” action.  From what you reported, I’m certain that the title field was generated correctly.

 

For the migration script to create a content_type record with a null title, there must have been an existing workflow or file with a null “content_type” field before the migration ran.  If you’ve still got a copy of the database before the migration, then a queries like the following should highlight where the problem is:

 

  SELECT id, title, content_type FROM workflows WHERE content_type IS NULL;

  SELECT id, title, content_type FROM blobs WHERE content_type IS NULL;

 

If you haven’t got the old database or you just want to fix up the data after migration 76 has run then you should be able to do something like this to resolve the problem:

 

  > ct = ContentType.find(:first)

  > ct.title = “Taverna 1”

  > ct.save

 

Repeat the above steps until it doesn’t find one with a null title.

 

Cheers,

Don.

 

From: address@hidden [mailto:address@hidden On Behalf Of David R Newman
Sent: 26 April 2009 18:59
To: 'Linde, A.E.'
Cc: address@hidden
Subject: RE: [Myexperiment-discuss] Content-type title error?

 

Hi Tony,

 

Some of the most recent SVN commits have been rationalising the content-type stuff.  So it is quite likely that this is a minor bug that has been introduced in the course of this work and would have been fixed shortly anyway.  Now you have spotted it, it will certainly be fixed.


Thanks and Regards

 

David Newman

 

From: address@hidden [mailto:address@hidden On Behalf Of Linde, A.E.
Sent: 26 April 2009 12:41
To: myexperiment-discuss
Subject: [Myexperiment-discuss] Content-type title error?

 

The error I’m getting is with Files and Workflows. With Files, it is in views/_table.rhtml where the code has changed from ‘blob.content_type’ to  ‘blob.content_type.title’: error text is ‘The error occurred while evaluating nil.title’.

And for Workflows, in the newly added div:

<div class="box_standout" style="text-align: center; margin-bottom: 1em; font-weight: bold; line-height: 1.5em;">    <% Workflow.count(:all, :group => 'content_type_id').sort{|x,y| y[1] <=> x[1]}.each do |arr| %>        | <%= pluralize(arr[1], (h(ContentType.find_by_id(arr[0]).title + " workflow"))) %>    <% end %>    | </div>
Again, with the ContentType.find_by_id(arr[0]).title where the error is the same, ‘The error occurred while evaluating nil.title’.

So far, everything else seems to be working, including my own code additions (other than in workflows and files, which I can’t check of course).

Is there somewhere that the content-type for workflows and blobs needs to have a title added? And how do I do so? The db:migrate seemed to all work ok and the content-type section came up with:

== CreateContentTypes: migrating ==============================================
-- create_table(:content_types)
   -> 0.0035s
-- add_column(:workflows, :content_type_id, :integer)
   -> 0.1322s
-- add_column(:workflow_versions, :content_type_id, :integer)
   -> 0.0108s
-- add_column(:blobs, :content_type_id, :integer)
   -> 0.0212s
-- remove_column(:workflows, :content_type)
   -> 0.0220s
-- remove_column(:workflow_versions, :content_type)
   -> 0.0064s
-- remove_column(:blobs, :content_type)
   -> 0.0151s
== CreateContentTypes: migrated (0.4952s) =====================================

So looks ok though cannot see any ‘title’ there.

Any ideas?

Thanks,
Tony.

--
Tony Linde
Project Manager
Department of Physics & Astronomy
University of Leicester

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.238 / Virus Database: 270.12.3/2075 - Release Date: 04/22/09 17:25:00


reply via email to

[Prev in Thread] Current Thread [Next in Thread]