File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1170,14 +1170,17 @@ protected function _optionsOptions($fieldName, $options)
1170
1170
return $ options ;
1171
1171
}
1172
1172
1173
+ $ pluralize = true ;
1173
1174
if (substr ($ fieldName , -5 ) === '._ids ' ) {
1174
1175
$ fieldName = substr ($ fieldName , 0 , -5 );
1176
+ $ pluralize = false ;
1175
1177
} elseif (substr ($ fieldName , -3 ) === '_id ' ) {
1176
1178
$ fieldName = substr ($ fieldName , 0 , -3 );
1177
1179
}
1178
1180
$ fieldName = array_slice (explode ('. ' , $ fieldName ), -1 )[0 ];
1181
+
1179
1182
$ varName = Inflector::variable (
1180
- Inflector::pluralize ($ fieldName )
1183
+ $ pluralize ? Inflector::pluralize ($ fieldName ) : $ fieldName
1181
1184
);
1182
1185
$ varOptions = $ this ->_View ->get ($ varName );
1183
1186
if (!is_array ($ varOptions ) && !($ varOptions instanceof Traversable)) {
You can’t perform that action at this time.
0 commit comments