Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Structure Site Links

Status Resolved
Add-on / Version
Severity Critical
EE Version

Chip Lay

Nov 06, 2012

We’re having an issue on several sites with site url links from structure and encoding of the fancy brackets.  Here is the modification we made to the ext.wyvern.php file if its helpful for anyone else:

Line 207

It wont respect the preg_match on line 221 - so here it is in plain text:

preg_match_all(”/{page_url:(d+)}|{;page_url:(d+)};/”, $tagdata, $matches); 

(the double semi-colon is actually a forward slash, then a semi-colon)

function channel_entries_tagdata_end($tagdata, $row, $instance)
    {
        if($this->parse_order == 'early')
        {
            log_message('debug', 'Wyvern: Parsing {page_url:N} variables - channel_entries_tagdata_end - line 193 ext.wyvern.php');
            
            // has this hook already been called?
            if ($this->EE->extensions->last_call)
            {
                $tagdata = $this->EE->extensions->last_call;
            }
            
            preg_match_all("/{page_url:(d+)}|{;page_url:(d+)};/", $tagdata, $matches);

            if(count($matches) > 0)
            {
                foreach($matches[1] as $match => $mval)
                {
                    // If the page ID exists, replace the tag accordingly
                    if(isset($this->EE->config->_global_vars['page_url:'.$mval]))
                    {
                        $tagdata = preg_replace("/{page_url:$mval}/", $this->EE->config->_global_vars['page_url:'.$mval], $tagdata);
                    }
                    // If not, then replace the tag with a blank string, we don't want the tag itself to be rendered
                    else
                    {
                        $tagdata = preg_replace("/{page_url:$mval}/", '', $tagdata);
                    }
                }

                foreach($matches[2] as $match => $mval)
                {
                    // If the page ID exists, replace the tag accordingly
                    if(isset($this->EE->config->_global_vars['page_url:'.$mval]))
                    {
                        $tagdata = preg_replace("/{;page_url:$mval};/", $this->EE->config->_global_vars['page_url:'.$mval], $tagdata);
                    }
                    // If not, then replace the tag with a blank string, we don't want the tag itself to be rendered
                    else
                    {
                        $tagdata = preg_replace("/{;page_url:$mval};/", '', $tagdata);
                    }
                }
            }
        }
        // $tagdata = "";
        
        return $tagdata;
    }
#1

BoldMinded (Brian)

Thanks for the report. I encountered something similar a couple weeks ago and fixed it this way (haven’t released it yet though) b/c I wasn’t sure if it was unique to my environment or if it was a real issue.

http://www.evernote.com/shard/s9/sh/7dfa371f-ff39-4816-8607-f0a640bfccb5/5c5ed1170d6df8791dd70e93c4ed336c

I assume you’re on EE 2.5.3?

#2

Chip Lay

2.5.3 on two of the sites with the issue, but 2.5.1 on another. We also saw instances where inside the same Wyvern field, some encoding would be correct, and some not - which it why we left both cases in the preg_match and replaced both. Its really weird because we’ve never hit this issue before and it just seems to have popped up all the sudden.

#3

Brian Litzinger

Yeah, I’m not sure what the cause is to be honest, but the latest version (2.5.4) should fix it.

Login to reply