It seems that rdf_mapping_load can't access the RDF mapping for bundles declared using Entity API anymore.

I've been trying to figure out exactly what is going on for a few hours now. I've tried Profile2 and Field Collection. I know that at least Field Collection did work in February. I hope I'm not missing something obvious, but I have been poking around for a few hours to no avail, trying to figure out what went wrong here.

I am using dev versions of all modules.

Comments

ronald_istos’s picture

Hi Lin - is the mapping there but the function can't access it or is the mapping lost completely?

Anonymous’s picture

Mapping is in the database, but it isn't being attached to the entity.

There is also a chance I'm going nuts :-/

scor’s picture

are core entities also broken (node, user, ...), or is it just entities provided via entity api?

Anonymous’s picture

core entities are not broken for me. Just entities using the entity api.

Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

OK, a drush si fixed this. I'm going to test it again with the database as it was before I installed everything to see whether I can recreate it.

scor’s picture

Maybe you incorrectly authored the RDF mappings? did you programmatically insert them in the db? or did you do it?

Anonymous’s picture

I used RDF UI... I"ve gone back and forth between the two databases a few times now, doing the same to both. It is definitely a problem with configuration somewhere outside the mapping itself. It doesn't even save the mapping at all when I'm using RDF UI.

The site I was first trying with is a site that was migrated from Drupal 6 to Drupal 7.

In the site that was migrated from Drupal 6 to Drupal 7, the bundle isn't registered when it gets to rdf_entity_info_alter. In the fresh install, it is.

Maybe there is a difference in the order of hook firing when you migrate a site from 6?? Sounds crazy, but I'll give it a shot.

Anonymous’s picture

Title: Entity API entities no longer load core RDF mappings » Entity API doesn't load RDF mappings on sites migrated from Drupal 6
Status: Postponed (maintainer needs more info) » Needs work

So I was right, the hook implementation call order is different

Migrated site:

  1. rdf
  2. entity
  3. profile2
  4. token

Fresh install:

  1. entity
  2. profile2
  3. rdf

This bug is related to using hook_entity_info_alter to register bundles.

This also causes these other problems:
#1123236: Using hook_entity_info_alter to add bundles results in Notices on manage fields
#1092192: Using hook_entity_info_alter to add the bundles prevents some modules from altering entities

Anonymous’s picture

Title: Entity API doesn't load RDF mappings on sites migrated from Drupal 6 » Entity API doesn't load RDF mappings on sites with RDF enabled in Drupal 6

In the DB, RDF module has a weight of -10. This is because RDF module in Drupal 6 set the weight of RDF at -10.

http://drupalcode.org/project/rdf.git/blob/c107f700e9ebdb0b3ba7df7ef74e3...

So this is somewhat of an edge case. However, it will affect the people most interested in RDF, so those that most want RDF are going to be the ones that don't have it.

Since it relies so much on hook order, this seems like a brittle pattern to use.

fago’s picture

Project: Entity API » Resource Description Framework (RDF)
Version: 7.x-1.x-dev » 6.x-1.x-dev
Component: Core integration » Code

>In the DB, RDF module has a weight of -10. This is because RDF module in Drupal 6 set the weight of RDF at -10.

ouch. Sounds more like a rdf.module bug then. Does core rdf module install properly if contrib RDF was active previously? Maybe contrib RDF should be uninstalled in d6 before d7 upgrade is attempted?

Anonymous’s picture

Yes, the core RDF module does install if contrib was install previously. I don't think that module uninstall is the correct way to go, that has been explicitly deprecated in handbook instructions and we can't feasibly expect users to check the upgrade files for each module before upgrading each site.

smustgrave’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)