diff --git a/library/Icingadb/Model/NotesUrl.php b/library/Icingadb/Model/NotesUrl.php index 81c77e15..bd313a7e 100644 --- a/library/Icingadb/Model/NotesUrl.php +++ b/library/Icingadb/Model/NotesUrl.php @@ -32,6 +32,8 @@ class NotesUrl extends Model $relations->hasMany('host', Host::class) ->setCandidateKey('id') ->setForeignKey('notes_url_id'); - $relations->hasMany('service', Service::class); + $relations->hasMany('service', Service::class) + ->setCandidateKey('id') + ->setForeignKey('notes_url_id'); } } diff --git a/library/Icingadb/Model/Service.php b/library/Icingadb/Model/Service.php index f1d27adc..ece2cd13 100644 --- a/library/Icingadb/Model/Service.php +++ b/library/Icingadb/Model/Service.php @@ -92,7 +92,9 @@ class Service extends Model $relations->belongsTo('action_url', ActionUrl::class) ->setCandidateKey('action_url_id') ->setForeignKey('id'); - $relations->belongsTo('notes_url', NotesUrl::class); + $relations->belongsTo('notes_url', NotesUrl::class) + ->setCandidateKey('notes_url_id') + ->setForeignKey('id'); $relations->belongsTo('icon_image', IconImage::class); $relations->belongsTo('zone', Zone::class); $relations->belongsTo('endpoint', Endpoint::class)