Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX SiteTreeLinkTracking_Parser should use the getAnchorsOnPage (#2697)
Currently, the SiteTreeLinkTracking_Parser only checks the page's content for anchors. As a result, any anchors that have been added or modified by the updateAnchorsOnPage extension in the getAnchorsOnPage method are marked ss-broken. This change updates SiteTreeLinkTracking_Parser to get the anchors from the getAnchorsOnPage function on SiteTree. This will allow for more consistent RegEx matching and allow the updateAnchorsOnPage extension to be used when checking for broken links.
- Loading branch information
1 parent
e7c49fa
commit bcbeb6d
Showing
3 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace SilverStripe\CMS\Tests\Model; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\DataExtension; | ||
|
||
class SiteTreeLinkTracking_Extension extends DataExtension implements TestOnly | ||
{ | ||
public function updateAnchorsOnPage(&$anchors) | ||
{ | ||
array_push( | ||
$anchors, | ||
'extension-anchor', | ||
'extension-anchor-1' | ||
); | ||
} | ||
} |