Skip to content

Commit

Permalink
Remove unused alternative attachment serving methods
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Jul 13, 2018
1 parent 72f7bff commit 94b6d69
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
6 changes: 0 additions & 6 deletions lib/midcom/core/context.php
Expand Up @@ -315,12 +315,6 @@ public function run()
if (empty($object->guid)) {
throw new midcom_error('Root node missing.');
}

if ($object instanceof midcom_db_attachment) {
midcom::get()->serve_attachment($object);
// This will exit
}

} while ($this->parser->get_object() !== false);

// Check whether the component can handle the request.
Expand Down
4 changes: 0 additions & 4 deletions lib/midcom/core/dbaobject.php
Expand Up @@ -360,10 +360,6 @@ public function purge_attachments($constraints)
{
return $this->__object->purge_attachments($constraints);
}
public static function serve_attachment($guid)
{
midcom::get()->serve_attachment(new midcom_db_attachment($guid));
}
public function has_parameters()
{
return $this->__object->has_parameters();
Expand Down
16 changes: 3 additions & 13 deletions lib/midcom/core/service/implementation/urlparsertopic.php
Expand Up @@ -102,22 +102,12 @@ public function get_object()
// Set to current topic
$this->objects[$object_url] = $qb->get_result(0);
} else {
//last load returned ACCESS DENIED, no sense to dig deeper
// last load returned ACCESS DENIED, no sense to dig deeper
if ($qb->denied > 0) {
midcom_connection::set_error(MGD_ERR_ACCESS_DENIED);
return false;
}
// No topics matching path, check for attachments
$att_qb = midcom_db_attachment::new_query_builder();
$att_qb->add_constraint('name', '=', $this->argv[0]);
$att_qb->add_constraint('parentguid', '=', $this->get_current_object()->guid);
if ($att_qb->count() == 0) {
// allow for handler switches to work
return false;
}

// Set as current object
$this->objects[$object_url] = $att_qb->get_result(0);
// allow for handler switches to work
return false;
}
}
// Remove this component from path
Expand Down

0 comments on commit 94b6d69

Please sign in to comment.