Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.4] Fix components rendering the document for no reason #39466

Open
wants to merge 3 commits into
base: 4.4-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class JsonapiView extends BaseApiView
*
* @param array|null $items Array of items
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand All @@ -109,15 +109,15 @@ public function displayList(array $items = null)
$this->fieldsToRenderList[] = $field->name;
}

return parent::displayList();
parent::displayList();
}

/**
* Execute and display a template script.
*
* @param object $item Item
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand All @@ -141,7 +141,7 @@ public function displayItem($item = null)
throw new RouteNotFoundException('Item does not exist');
}

return parent::displayItem($item);
parent::displayItem($item);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class JsonapiView extends BaseApiView
*
* @param array|null $items Array of items
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand Down Expand Up @@ -101,8 +101,6 @@ public function displayList(array $items = null)

// Set the data into the document and render it
$this->getDocument()->setData($collection);

return $this->getDocument()->render();
}

/**
Expand Down
4 changes: 1 addition & 3 deletions api/components/com_config/src/View/Component/JsonapiView.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class JsonapiView extends BaseApiView
*
* @param array|null $items Array of items
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand Down Expand Up @@ -113,8 +113,6 @@ public function displayList(array $items = null)

// Set the data into the document and render it
$this->getDocument()->setData($collection);

return $this->getDocument()->render();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions api/components/com_contact/src/View/Contacts/JsonapiView.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function __construct($config = [])
*
* @param array|null $items Array of items
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand All @@ -140,7 +140,7 @@ public function displayList(array $items = null)
$this->fieldsToRenderList[] = $field->name;
}

return parent::displayList();
parent::displayList();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions api/components/com_content/src/View/Articles/JsonapiView.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function __construct($config = [])
*
* @param array|null $items Array of items
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand All @@ -150,7 +150,7 @@ public function displayList(array $items = null)
$this->fieldsToRenderList[] = $field->name;
}

return parent::displayList();
parent::displayList();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function displayItem($item = null)
*
* @param array|null $items Array of items
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand All @@ -81,7 +81,7 @@ public function displayList(array $items = null)
$items[] = $this->prepareItem($item);
}

return parent::displayList($items);
parent::displayList($items);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class JsonapiView extends BaseApiView
*
* @param array|null $items Array of items
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand Down Expand Up @@ -78,8 +78,6 @@ public function displayList(array $items = null)

// Set the data into the document and render it
$this->getDocument()->setData($collection);

return $this->getDocument()->render();
}

/**
Expand Down
4 changes: 1 addition & 3 deletions api/components/com_menus/src/View/Items/JsonapiView.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class JsonapiView extends BaseApiView
/**
* Execute and display a list items types.
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand Down Expand Up @@ -185,8 +185,6 @@ public function displayListTypes()
->addLink('next', (string) $nextPage)
->addLink('previous', (string) $previousPage)
->addLink('last', (string) $lastPage);

return $this->getDocument()->render();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions api/components/com_modules/src/View/Modules/JsonapiView.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function displayItem($item = null)
/**
* Execute and display a list modules types.
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand All @@ -136,6 +136,6 @@ public function displayListTypes()

$this->fieldsToRenderList = ['id', 'name', 'module', 'xml', 'desc'];

return parent::displayList($items);
parent::displayList($items);
}
}
8 changes: 2 additions & 6 deletions libraries/src/MVC/View/JsonApiView.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function __construct($config = [])
*
* @param array|null $items Array of items
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand Down Expand Up @@ -194,16 +194,14 @@ public function displayList(array $items = null)

// Set the data into the document and render it
$this->getDocument()->setData($collection);

return $this->getDocument()->render();
}

/**
* Execute and display a template script.
*
* @param object $item Item
*
* @return string
* @return void
*
* @since 4.0.0
*/
Expand Down Expand Up @@ -248,8 +246,6 @@ public function displayItem($item = null)

$this->getDocument()->setData($element);
$this->getDocument()->addLink('self', Uri::current());

return $this->getDocument()->render();
}

/**
Expand Down