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: Linde, A.E.
Subject: Re: [Myexperiment-discuss] Content-type title error?
Date: Thu, 30 Apr 2009 15:16:52 +0100

Thanks, Don. That worked fine: can now see workflows and files (added an entry for text/plain as well for the file I uploaded) and I was able to uplaod another Taverna1 workflow.

T.

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



From: Don Cruickshank <address@hidden>
Date: Thu, 30 Apr 2009 13:19:55 +0100
To: "Linde, A.E." <address@hidden>, myexperiment-discuss <address@hidden>
Subject: RE: [Myexperiment-discuss] Content-type title error?

OK.
 
I’ve just set up a local installation of your codebase and found the problem.  During the data migration I didn’t force create content type records for workflow types that have processor classes defined.  I’ll commit a fix for this shortly to the myExperiment codebase, but in the meantime you can create the missing types manually with:
 
 $ ruby script/console
 
  u = User.find_by_username('dgc')
 
  ContentType.create(:title => 'Taverna 1',         :mime_type => 'application/vnd.taverna.scufl+xml', :user_id => u.id)
  ContentType.create(:title => 'Taverna 2 beta',    :mime_type => 'application/octet-stream',          :user_id => u.id)
  ContentType.create(:title => 'Trident (XOML)',    :mime_type => 'application/xaml+xml',              :user_id => u.id)
  ContentType.create(:title => 'Trident (Package)', :mime_type => 'application/octet-stream',         :user_id => u.id)

Cheers,
Don.
 

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

I thought of getting around this problem by adding a workflow, which I figured would add the appropriate content_types entry, and then assigning that same content_type to the other workflows but that did not work (see attached screenshot and log).

So, how does the code check if a content_type already exists?

And can someone dump the myexperiment.org content_types table (or at least the Taverna1 and textfile records) so I can try manually creating the records – see if that works.

Cheers,
Tony.

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


From: "Linde, A.E." <address@hidden>
Date: Mon, 27 Apr 2009 14:19:55 +0100
To: myexperiment-discuss <address@hidden>
Subject: Re: [Myexperiment-discuss] Content-type title error?

No idea why that failed, Don, but the myExperiment code itself certainly works fine. I removed the content type references from workflows/index.rhtml and _table.rhtml and the page loaded fine (see screenshot). So, I think I only need to create the content_types table records and link them up to the blobs and workflows tables and it’ll work. Can you send me a readout of your content_types table?

Thanks,
Tony.

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


From: Don Cruickshank <address@hidden>
Date: Mon, 27 Apr 2009 13:21:21 +0100
To: "Linde, A.E." <address@hidden>, myexperiment-discuss <address@hidden>
Subject: RE: [Myexperiment-discuss] Content-type title error?

I’ve just gone through the process again and checked out the log files you attached and the cause appears to be something more weird than I had originally thought.  The migration log performs an SQL execute statement for each workflow and none showed up in the log, so it seems that “Workflow.find(:all)” failed to find any workflows...
 
The Taverna 1 and text file records from our database are attached.
 
Cheers,
Don.
 

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

Thanks for that, Don. I’ve just checked the workflows and blobs tables in m2_development database and the content_type_id field for all records is NULL and the content_types table is empty.

No, I don’t have access to the old database but the workflows and files were created normally: the workflows seem to be shown as taverna1 types (see attached screenshot from old presentation).

Can you dump a couple of the records in your content_types table for me: one for the taverna1 type workflow and one for a text file. I’ll then try and populate the tables manually.

Cheers,
Tony.

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



From: Don Cruickshank <address@hidden>
Date: Sun, 26 Apr 2009 22:55:37 +0100
To: David R Newman <address@hidden>, "Linde, A.E." <address@hidden>
Cc: myexperiment-discuss <address@hidden>
Subject: RE: [Myexperiment-discuss] Content-type title error?

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]