sonata-project/SonataAdminBundle — pull request #800 by benlumley (2012-06-03 11:27:35+00:00)
Title: buildShow correctly detects and avoids entering a look, in line with other buildXXX methods.

Minor change to the way Admin::buildShow works so that it can correctly detect and avoid entering a tight loop.

Info:

buildList, buildForm etc all set $this->[datagrid|list|etc] early on in
the method, meaning the return statement in the top of the methods can
correctly detect and return when the method is called again from within
itself.

buildShow was not setting $this->show until the of the method, which left
it susceptible to entering a loop, which ultimately causes an exception
from showMapper as it tries to re-add already existing fields.