Posted by linclark on May 20, 2011 at 2:14pm
4 followers
Jump to:
| Project: | Resource Description Framework (RDF) |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
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
#1
Hi Lin - is the mapping there but the function can't access it or is the mapping lost completely?
#2
Mapping is in the database, but it isn't being attached to the entity.
There is also a chance I'm going nuts :-/
#3
are core entities also broken (node, user, ...), or is it just entities provided via entity api?
#4
core entities are not broken for me. Just entities using the entity api.
#5
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.
#6
Maybe you incorrectly authored the RDF mappings? did you programmatically insert them in the db? or did you do it?
#7
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.
#8
So I was right, the hook implementation call order is different
Migrated site:
Fresh install:
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
#9
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.
#10
>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?
#11
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.