Error: Content type X has Drupal core comment comment type, but is a comment type itself for the following content types - drupal

I'm using Node Comments module and I get a strange error in Status Report:
Node Comments
Content type Answer has Drupal core comment comment type, but is a comment type itself for the following content types: Forum topic
However, in the content type settings of 'Answer', this setting is disabled:
http://dl.dropbox.com/u/72686/CommentSettings.png
thanks

In the description under 'Node Type for Comments': "Important: Every content type which is a comment type should have itself as comment type. Also every comment node type should have at least 1 another content type using it."

What you show is the default setting. It is still possible that one of the comment nodes has a comment somewhere. You can use SQL to investigate.
To be sure that no one can create comments, you need to remove the option in the node create form. However, this wont solve the problem with the already created comment.

Related

Converting Archetype Content to Folderish

I have an archetype content type that previously was not folderish. Now I have set it as folderish. What attribute or properties need to be changed so that any data created before can be migrated?
I have read the following documents:
Generic Setup Upgrade Steps
Converting one Content Type into another
I followed the above tutorial on upgrade steps but I do not know which attribute or properties to change.
You could use Products.contentmigration. See it's doc to find out how to use it, it shouldn't be too difficult: just define your CustomQueryWalker and the mapping between your two content types. In order to find out what field you have to map, just put a pdb somewhere in the content's view and inspect the content schema.
similar question here: Migrating from (now obsolete) custom ATImage content type
i stumbled accross the same issue when trying to migrate non-folderish types to folderish ones based on: http://pypi.python.org/pypi/collective.folderishtypes
that helped: on a context to convert, call ##migrate-btrees view [1] to initialize the btree structure [2]. I assume your new Archetype content is plone.app.folder based.
[1] defined in: plone.app.folder.migration.BTreeMigrationView.
[2] Main work is done by: Products.BtreeFolder2.BTreeFolder2Base._initBtrees.

Crystal Report Page header suppress issue

I need to suppress the page header when there are no records in the detail section.I have used
onLastRecord
at page header->section expert->suppress.it works fine but issue is when there is only one record in the detail section.then page header is suppress how can i avoid this?
I think your question requires more detail.
Anyway, based on what I have understood, I would suggest any of these ways to sort out this issue.
Add a count() function formula to the suppress section. Find details here.
Add a condition like OnLastRecord or {GROUP FIELD NAME} <> Next({GROUP FIELD NAME}). Find details here.
Check for IsNull({table.field}) of a non-null field.
Check whether the DisctinctCount of the PK field is null.

How do I add taxonomy terms using Drupal Migrate

I'm using the migrate module to copy data from several sources to a new drupal installation. So far, I'm able to replicate a lot of what I need from the examples provided with the module. I'm currently stuck on adding terms or taxonomy to newly created nodes. The example shows:
// These are related terms, which by default will be looked up by name
$this->addFieldMapping('migrate_example_beer_styles', 'terms')
->separator(',');
I've tracked down the migrate_example_beer_styles destination mapping and it seems to be the machine name for that taxonomy.
I've tried imitating this behavior with every variation of what my machine_name should be, but the terms never seem to get associated:
By id:
// where source breed_id is '1,100' - it finds mapped values accordingly
$this->addFieldMapping('breeds', 'breed_id')
->sourceMigration('BreedMigration')
->separator(',')
And, by name:
// where source breeds is 'Dogs,German Shepherd'
$this->addFieldMapping('breeds', 'breeds')
->separator(',');
Am I wrong assuming the destination mapping is the machine name for a taxonomy?
This version of the migrate module was released recently, I haven't found any other helpful examples on the web.
This question still seems to be getting some views, so I thought I'd add what else I've discovered. While the accepted answer works, you are able to map Vocabs on ID:
$this->addFieldMapping('Exact Case Sensitive Vocab Name', 'source_field_name')
->sourceMigration('ExactSourceClassName')
->arguments(array('source_type' => 'tid'))
->separator(',');
->separator(',') used for passing a delimited string of source ids. Obviously, leave that off if you're mapping an array of values.
I'm currently working with migrate module myself, and I agree that the documentation is somewhat wanting at this point. :)
The 'machine name' of a vocabulary is listed in the Vocabulary table, in the field 'module'. Try using that value. Do note that you need to feed the text into the mapping, not the ids.
This is my first post on stackoverflow, so I apologize in advance if this isn't the accepted way to submit more information concerning this issue...
I've been stumbling around with the Migrate module for the past few days and was looking for a way to do this in Drupal 7. I had a comma-delimited list of taxonomy ids within an XML field that I wanted to use, but every example I found was retrieving from an external class, or from a database source.
Anyway, through trial and error, I found that you can use a field within the migrate class, rather than reference an external term migration class.
$this->addFieldMapping('field_article_type', 'category_id')
->arguments(array('source_type' => 'tid'))
->xpath('/article/category_id')
->separator(',');
Check out the taxonomy csv import module at http://drupal.org/project/taxonomy_csv.
It was easy to use and did what it was supposed to and more.
I ended up only using the migrate module for importin gNodes and used this module for the taxonomy. It was a pleasure to use.

How to get a excerpt content of a node?

I am having a node reference.How can i get its excerpt content?
For getting title or body we use:-
print $entry->title;
print $entry->body;
How i can get the excerpt of that node.(i am using excerpt module)
For the stock teaser, it would be $entry->teaser but your best bet is to use
drupal_set_message(print_r($entry, true))
and look through the key=>value pairs.
For a better looking array, install the Devel module and use
dsm($entry)
The teaser of a node is contained in $entry->teaser; if the field is not initialized, then the function node_teaser() is the function used to build the teaser.
If the module is saving a custom value as excerpt, you should verify which is the property used from the module (I would check $entry->excerpt, though).
I would suggest you to install Devel, which has some debug functions, including dsm() that allows to inspect any PHP value, and also adds a tab "Devel" for each node.
Can you var_dump $entry? Does it have more data?

Drupal 6: getting particular fields from Node Reference types

I'm a drupal newbie...
<?php print $node->field_date[0]['view']; ?>
I can get the custom created CCK fields' value and display in tpl.php files as above... that's fine.
my question is how can I get the Node reference fields' in-fields? for example, I have an event content type, and I have defined Node Reference for Location (title, address, img, etc.). When I write the code below, it displays all location content;
<?php print $node->field_location[0]['view']; ?>
but I need to get only address field from this location content type. sth like below would be great :D but not working;
<?php print $node->field_location[0]['field_address']['view']; ?>
so how can get that? appreciate helps so much! thanks a lot!
You should inspect/dump the content of the $node->field_location array. I do not have a test installation at hand right now, so I can't say for sure, but I'd expect that at least the referenced nodes id ('nid') should be in that array somewhere. With that, you can do a node_load($nid), which returns the full node object, thus providing access to the fields.
(As said, I'm not sure, but the field array might already contain the whole node object as well, saving you from the need to load it explicitely.)
The $node->field_location[0]['view']; returns the node as it was defined in the Display Fields section of the content type definition. This might work for your advantage. You can trick it: use a Teaser display for that node and customize the node Teaser display to fit your needs. Just a thought.
If that doesn’t work for you, you will need to load the node separately. You can use $node->field_location[0]['nid']; to get the node ID, so you will end up with something like this:
node_load($node->field_location[0]['nid'])->field_address[0]['view']
I'm not sure how this performs...

Resources