Terra: Fix the broken editmetadata popup.

Based on a patch from furti (at) 1012surf.net

Fixes #10146.