I have possibly found a new bug, some background first:
I am running modx 1.0.4 with yams 1.2.0 RC3.
My Website has 2 languages, English as default and French.
I have a number of pages in the site that are ’weblink’ containets and the links usually point to their first child.
To implement the weblinks, I have set the Resource Type of the page to ’Weblink’ and
added the id of the document they redirect to ( my about-us/overview page ) in both the english content and french content areas.
When I use wayfinder, I am generating urls using yams_docr. In the english section, when I click the About us link, I am directed perfectly to about-us/overview. But When I am in french section, they do not, the url is empty, and I am directed back to "/" .
After some looking, I found some code in yams.class.inc.php, around line 3705 in private function GetDocResolvedURL,
It seemed to be:
if ( in_array( $newDocId, $seenDocIds ) )
{
$expandArray[ $langId ] = '';
}
else
{
array_push( $seenDocIds, $newDocId );
$expandArray[ $langId ] =
$this->GetDocResolvedURL(
$newDocId
, $mode
, $seenDocIds
);
}
The effect is, it generates the redirect for english, but when it parses french, it just sets the url to ’’, ( to prevent recursion ), I have made a change to fix this, so the code would be more like:
if ( !in_array( $newDocId, $seenDocIds ) ) array_push( $seenDocIds, $newDocId );
$expandArray[ $langId ] =
$this->GetDocResolvedURL(
$newDocId
, $mode
, $seenDocIds
);
This seems to solve my problem, I think you just want to preserve the $seenDocIds array, but it every case, you want to always resolve the url for all langagues. There is another spot in this function just below this where a similar fix could be applied as well. Anyone have any thoughts on this?