create_relationship error trigger

February 22, 2006 at 3:31 pm

By nwhite

Share post:

The create_relationship function in admin_actions.php3 provides no indication of whether it succeeded or not, and is perfectly willing to create relationships where entity_a, entity_b, and relationship_type are values such as 0, null, or ''. There are thousands of relationships of type 0 in the relationship table on chicago (i removed the ones in the dev database). Instead of enforcing any strict rules, the trigger_error function is now called when create_relationship receives empty parameters. In this way, we can debug and fix whatever is creating invalid relationships and then consider whether the function itself should police the relationships it is creating.