This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 213
URL to article stays valid when unpublished or protected #8264
Comments
|
Possible fix or workaround: replace https://github.com/contao/core/blob/3.5.8/system/modules/core/modules/ModuleArticle.php#L61 with $objHandler = new $GLOBALS['TL_PTY']['error_404']();
$objHandler->generate($this->alias); |
|
o.k. - going well! public function generate($blnNoMarkup=false)
{
if (TL_MODE == 'FE' && !BE_USER_LOGGED_IN && (!$this->published || ($this->start != '' && $this->start > time()) || ($this->stop != '' && $this->stop < time())))
{
- return '';
+ $objHandler = new $GLOBALS['TL_PTY']['error_404']();
+ $objHandler->generate($this->alias);
}
$this->type = 'article';
$this->blnNoMarkup = $blnNoMarkup;
return parent::generate();
} |
|
The URL to protected articles stays valid too. The aforementioned workaround/fix has no effect in such a case. I was wrong about seeing the title and teaser of the unpublished or protected article though - no information about the unpublished or protected article is visible in the frontend, when accessed via its URL. (At least I couldn't reproduce that now.) |
|
Fixed in d9ef512. |
|
Thanks! |
leofeyer
added a commit
that referenced
this issue
Mar 21, 2016
jsonn
pushed a commit
to jsonn/pkgsrc
that referenced
this issue
Mar 26, 2016
### 4.1.2 (2016-03-22) * Handle derived classes in the exception converter (see #462). * Prevent the autofocus attribute from being added multiple times (see contao/core#8281). * Respect the SSL settings of the root page when generating sitemaps (see contao/core#8270). * Read from the temporary file if it has not been closed yet (see contao/core#8269). * Always use HTTPS if the target server supports SSL connections (see contao/core#8183). * Adjust the meta wizard field length to the column length (see contao/core#8277). * Correctly handle custom mime icon paths (see contao/core#8275). * Show the 404 error page if an unpublished article is requested (see contao/core#8264). * Correctly count the URLs when rebuilding the search index (see contao/core#8262). * Ensure that every image has a width and height attribute (see contao/core#8162). * Set the correct mime type when embedding SVG images (see contao/core#8245). * Handle the "float_left" and "float_right" classes in the back end (see contao/core#8239). * Consider the fallback language if a page alias is ambiguous (see contao/core#8142). * Fix the error 403/404 redirect (see contao/website#74).
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Problem
If you unpublish an article, its URL, i.e.
/page/articles/article.htmlstays valid and simply shows an empty page - but with the title of the (unpublished) article and either description (teaser) of the article or, when not available, the description of the page of the article. Contao will only show a 404 page, if you delete the article completely.Reproduction
Shortcut:
/page-alias/articles/article-alias.htmlYou'll see an empty page with the title of the unpublished article and, when available, the teaser of the article in the meta description (or the page's meta description otherwise).
Expected behaviour
The text was updated successfully, but these errors were encountered: