Fix #2023

This fix is needed for https://drupal.org/node/2270509
See also #2708
I changed the PR to handle the constant.
Concerning the lines 2583-2584, I didn't see any case where a change is needed.