diff --git a/product/ERP5/Document/TextDocument.py b/product/ERP5/Document/TextDocument.py
index 7446507f069fca4bbd2dfa4efb3c3ed5c7af7834..887a03a9601b2be7941d3ae6e4c84ae7b16b88f2 100644
--- a/product/ERP5/Document/TextDocument.py
+++ b/product/ERP5/Document/TextDocument.py
@@ -86,12 +86,13 @@ class TextDocument(CachedConvertableMixin, BaseConvertableFileMixin,
       method_id = self.getTextContentSubstitutionMappingMethodId()
       if method_id:
         try:
-          mapping = guarded_getattr(self, method_id)(**kw)
+          method = guarded_getattr(self, method_id)
         except AttributeError:
           LOG('TextDocument', WARNING, 'could not get the substitution'
               ' mapping method %s from %r, so the content will not be'
               ' substituted.' % (method_id, self.getRelativeUrl()))
           return text
+        mapping = method(**kw)
 
         is_str = isinstance(text, str)
         if is_str: