Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENHANCEMENT Ensure that broken File links receive an "ss-broken" clas…

…s, just like broken SiteTree links
  • Loading branch information...
commit f5c4bc0802062de3db60d1c45975d97140860c07 1 parent 898c8f5
Sean Harvey halkyon authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 forms/HtmlEditorField.php
9 forms/HtmlEditorField.php
View
@@ -69,8 +69,15 @@ function Field() {
$link->setAttribute('class', ($class ? "$class ss-broken" : 'ss-broken'));
}
}
+
+ if(preg_match('/\[file_link id=([0-9]+)\]/i', $link->getAttribute('href'), $matches)) {
+ if(!DataObject::get_by_id('File', $matches[1])) {
+ $class = $link->getAttribute('class');
+ $link->setAttribute('class', ($class ? "$class ss-broken" : 'ss-broken'));
+ }
+ }
}
-
+
return $this->createTag (
'textarea',
$this->getAttributes(),
Please sign in to comment.
Something went wrong with that request. Please try again.