Ticket #18351

This branch contains tests and a fix based on the suggested use of a decorator.