ExpressionEngine version: 7.5.26
RTE version: 2.2.0
Pro Variables version: 5.0.3
When an RTE field is used as a Pro Variables variable, internal page links are stored correctly as page tokens—for example:
<a href="{page_181}">3 ways to save</a>
When the variable is reopened in the control panel, the RTE correctly displays the human-readable URI. However, outputting the variable through Pro Variables leaves {page_181} unresolved in the rendered HTML.
Steps to reproduce:
- Create a Pro Variables variable using the RTE fieldtype.
- Add a link to an internal EE page.
- Save the variable.
- Output it using
{exp:pro_variables:single var="variable_name"}.
- Inspect the rendered link.
Expected result:
The stored {page_ID} token is converted back into the page URL.
Actual result:
The rendered href remains {page_ID}.
The RTE fieldtype’s save() method intentionally calls RteHelper::replacePageUrls(), while pre_process() calls RteHelper::replacePageTags() to reverse the conversion.
RTE already contains this variable-specific method:
public function var_display_tag($data)
{
return $this->replace_tag($this->pre_process($data));
}
However, Pro Variables’ bridge checks for var_replace_tag(), then the legacy display_var_tag(). Because neither exists on the RTE fieldtype, it falls back to the ordinary replace_tag() method. That method does not call pre_process(), so the page tokens remain unresolved.
A possible fix is to add a compatible method to the RTE fieldtype:
public function var_replace_tag($data, $params = array(), $tagdata = false)
{
return $this->replace_tag(
$this->pre_process($data),
$params,
$tagdata
);
}
Alternatively, the Pro Variables bridge could explicitly recognize the existing RTE var_display_tag() convention.
ExpressionEngine version: 7.5.26
RTE version: 2.2.0
Pro Variables version: 5.0.3
When an RTE field is used as a Pro Variables variable, internal page links are stored correctly as page tokens—for example:
When the variable is reopened in the control panel, the RTE correctly displays the human-readable URI. However, outputting the variable through Pro Variables leaves
{page_181}unresolved in the rendered HTML.Steps to reproduce:
{exp:pro_variables:single var="variable_name"}.Expected result:
The stored
{page_ID}token is converted back into the page URL.Actual result:
The rendered
hrefremains{page_ID}.The RTE fieldtype’s
save()method intentionally callsRteHelper::replacePageUrls(), whilepre_process()callsRteHelper::replacePageTags()to reverse the conversion.RTE already contains this variable-specific method:
However, Pro Variables’ bridge checks for
var_replace_tag(), then the legacydisplay_var_tag(). Because neither exists on the RTE fieldtype, it falls back to the ordinaryreplace_tag()method. That method does not callpre_process(), so the page tokens remain unresolved.A possible fix is to add a compatible method to the RTE fieldtype:
Alternatively, the Pro Variables bridge could explicitly recognize the existing RTE
var_display_tag()convention.