function syncLinkTracking() { // Build a list of HTMLText fields $allFields = $this->db(); $htmlFields = array(); foreach ($allFields as $field => $fieldSpec) { if (preg_match('/([^(]+)/', $fieldSpec, $matches)) { $class = $matches[0]; if (class_exists($class)) { if ($class == 'HTMLText' || is_subclass_of($class, 'HTMLText')) { $htmlFields[] = $field; } } } } $linkedPages = array(); $linkedFiles = array(); $this->HasBrokenLink = false; $this->HasBrokenFile = false; foreach ($htmlFields as $field) { $formField = new HTMLEditorField($field); $formField->setValue($this->{$field}); $formField->saveInto($this); } $this->extend('augmentSyncLinkTracking'); }
public function testSavingLinksWithoutHref() { $obj = $this->objFromFixture('HTMLEditorFieldTest_Object', 'home'); $editor = new HTMLEditorField('Content'); $editor->setValue('<p><a name="example-anchor"></a></p>'); $editor->saveInto($obj); $this->assertEquals('<p><a name="example-anchor"></a></p>', $obj->Content, 'Saving a link without a href attribute works'); }