RSM addFieldResult undefined index #5975

Open
opened 2026-01-22 15:23:51 +01:00 by admin · 0 comments
Owner

Originally created by @javabudd on GitHub (May 28, 2018).

Bug Report

BC Break: No
Version: 2.6.1

Summary

When calling addFieldResult on the ResultSetMapping object, an undefined index occurs if the alias provided is not in the alias map.

Current behavior

undefined index while attempting to access alias from alias map

How to reproduce

$rsm = new ResultSetMapping();
$rsm->addEntityResult(std::class, 'class')
        ->addFieldResult('class', 'id', 'id')
        ->addFieldResult('class', 'name', 'name')
        ->addFieldResult('undefinedAlias','id', 'id');

Expected behavior

An exception should be thrown instead of an undefined index

Originally created by @javabudd on GitHub (May 28, 2018). ### Bug Report BC Break: No Version: 2.6.1 #### Summary When calling addFieldResult on the ResultSetMapping object, an undefined index occurs if the alias provided is not in the alias map. #### Current behavior undefined index while attempting to access alias from alias map #### How to reproduce $rsm = new ResultSetMapping(); $rsm->addEntityResult(std::class, 'class') ->addFieldResult('class', 'id', 'id') ->addFieldResult('class', 'name', 'name') ->addFieldResult('undefinedAlias','id', 'id'); #### Expected behavior An exception should be thrown instead of an undefined index
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5975