import re


def error_034_template_elements(text):
    """Fix pagename magicwords and return (new_text, replacements_count) tuple."""
    return re.subn(r"{{(PAGENAME|FULLPAGENAME)}}", "{{subst:\\1}}", text)