Hi,

I found an error message on admin/structure/relation page:

    Notice: Undefined variable: return in relation_get_types() (line 457 of /Users/kalmanhosszu/web/d7-dev/sites/all/modules/custom/relation/relation.module).
    Warning: Invalid argument supplied for foreach() in relation_get_types() (line 457 of /Users/kalmanhosszu/web/d7-dev/sites/all/modules/custom/relation/relation.module).
CommentFileSizeAuthor
#1 1468454-1.patch467 byteskalman.hosszu

Comments

kalman.hosszu’s picture

Status: Active » Needs review
StatusFileSize
new467 bytes

A patch attached, I think wrong variable checked in the code.

Kálmán

anou’s picture

The patch from #1 fixes the problem (for me on version 7.x-1.0-rc1)

fradipa’s picture

...also for me for 7.x-1.0-rc1 on drupal 7.12;

Thank You.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Patch is correct.

chx’s picture

Status: Reviewed & tested by the community » Fixed

This is very weird, I am working on relation for a client and that relation.module has $return = $types ? ctools_export_crud_load_multiple('relation_type', $types) : ctools_export_crud_load_all('relation_type');. That's why it works for me. Crap. Time to a) release rc2 b) get someone to write tests for ctools import.

chx’s picture

Status: Fixed » Needs work
Issue tags: +Needs tests
chx’s picture

Title: Undefined variable in relation_get_types() function » Add tests for ctools exported relation types
mikran’s picture

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

We have ctools related test module and bunch of tests utilize the exported relation types for other purposes already so this is covered by now.