Git Product home page Git Product logo

news's Introduction

Latest Stable Version TYPO3 11 TYPO3 12 TYPO3 13 Total Downloads Monthly Downloads Build v11 Build v12 Crowdin Donate

TYPO3 Extension news

This extension implements a versatile news system based on Extbase & Fluid and uses the latest technologies provided by TYPO3 CMS.

It includes these features:

  • Support for editors and authors by

    • well-structured plugins with good preview functionality
    • a backend module with filter & search (Available as paid add-on EXT:news_administration)
    • frontend template variant based on Twitter Bootstrap v5.
  • Use of as many elements from the system core as possible, e.g. FAL and system categories.

  • Built-in support for content elements.

  • Support for Open Graph and social platforms in the default template.

  • Complete and comprehensive documentation.

It is a highly customizable framework for chronological organized content - much more than just a news list!

– Quote from a user

URL
Repository: https://github.com/georgringer/news
Read online: https://docs.typo3.org/p/georgringer/news/main/en-us/
TER: https://extensions.typo3.org/extension/news/

Compatibility

News TYPO3 PHP Support / Development
dev-12-13 12 - 13 8.2 - 8.3 unstable development branch
dev-main 11 - 12 7.4 - 8.3 unstable development branch
11 11 - 12 7.4 - 8.3 features, bugfixes, security updates
10 10 - 11 7.4 - 8.1 none
9 10 - 11 7.4 - 8.1 none
8 9.5 - 10 7.2 - 7.4 none
7.x 8.7 - 9.x 7.0 - 7.2 none
6.x 7.6 - 8.7 5.6 - 7.2 none
5.x 7.6 - 8.7 5.6 - 7.2 none
4.x 7.6 5.5 - 5.6 none
3.x 6.2 5.5 - 5.6 none

Contribute to this project to let your skills flow into its present and future architecture.

Sponsor us to get things done for your business - in time and quality.

news's People

Contributors

christophlehmann avatar codegm avatar derhansen avatar dfeyer avatar dmitryd avatar echavaillaz avatar erhaweb avatar froemken avatar fsaris avatar georgringer avatar helhum avatar jokumer avatar josefglatz avatar kitzberger avatar krohnmi avatar liayn avatar linawolf avatar lorenzulrich avatar mabahe avatar martinhummer avatar misterboe avatar neoblack avatar oliverklee avatar outdoorsman avatar peterkraume avatar pgampe avatar schugabe avatar sypets avatar t3easy avatar xperseguers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

news's Issues

Multilanguage List - wrong counting

Hey,

I have a multilanguage system. The news are eatch separated in a news item. So 1 news item for german, 1 news item for english.

Now i placed a list item on the front page. There i told the plugin to only show 3 news items.
Thats works great for german, propably because the first 3 news items in the list are german, but für english it dont work at all.
The 3 english news items are after the 3 german ones. So if i say.. show only 3 items it shows none at all. If I say, show all items, the english news items are shown.

Database Error

Hi,

I'm using TYPO3 6.2 and i recently updated tx_news to 3.0.1.
When I create/edit news i get the following error.

Unknown column 'tx_news_domain_model_category.sys_language_uid' in 'where clause'
A SQL error occurred. This may indicate a schema mismatch between TCA and the database. Try running database compare in the Install Tool.

There are also no categories in the 'options' tab.

I did the update-script in the extension manager.
If i use the fe-plugin the tree with "categories selection" works fine.

thx

Wrong prefilled date

On creating a new news, the date field is filled with a wrong date:
Today (25.02.2015, 08:40) the field shows: "16:12 5-2-2015"
The Next Installation shows: "15:18 6-2-2015"
and another Installation shows: "16:51 24-2-2015" all these installations are placed on different Servers.
Tested with TYPO3 Version 6.2.9
News Version 3.0.1

Count category entries

How do I count the number of category entries?
E.g.: category (2)

The value {category.item.countRelatedNews} is always null.

Title/Alt link FileDownload

Hello,

I'm using TYPO3 6.2.4 and news 3.0.1.

In viewhelper "Tx_News_ViewHelpers_Format_FileDownloadViewHelper", Typoscript properties "titleText" and "altText" does not work while $title and $alt aren't empty.

Thx

Unit Test failures

We have two failures in the Unit Test. In the following you see the two error messages:

Failure in test case viewHelperReturnsFileSizeWithDefaultFormat
File: typo3conf/ext/news/Tests/Unit/ViewHelpers/Format/FileSizeViewHelperTest.php
Line: 36
Failed asserting that two strings are equal.
'14.4 K' '14.35 Ki'

Failure in test case viewHelperReturnsFileSizeWithGivenFormat
File: typo3conf/ext/news/Tests/Unit/ViewHelpers/Format/FileSizeViewHelperTest.php
Line: 48
Failed asserting that two strings are equal.
'14.4 '14.35 A'

We use TYPO3 6.2.14 and news plugin 3.2.4

Error in change from 29.07.2014

If I try to edit a new item in List-Mode I get a blank page and the following error in php.log

[30-Jul-2014 08:28:17 UTC] PHP Parse error: syntax error, unexpected '[' in /html/typo3conf/ext/news/Classes/Service/AccessControlService.php on line 80

Exception when using it in a composer environment

We just updated the extension to 4.2, which does not work anymore in a composer environment. The following error did not happen with 4.1.

Looks like there is a class referenced which was removed in the last version, so we get the following error message:
Fatal error: Class 'GeorgRinger\News\Database\SoftReferenceIndex' not found in /home/svtilocal/web/typo3conf/ext/news/Migrations/Code/LegacyClassesForIde.php on line 36

I don't know why the LegacyClassesForIde.php is included. Probably for backwards compatibility.

3.0.1 Problems

I'm running Typo3 6.2.3.

After upgrading News from 2.3.1 or in a fresh install, I faced an error of missing tx_news_domain_model_category table on the database. I copied the SQL from version 2.3.1 and added to 3.0.1 and executed Database analyzer.

Missing SQL on ext_tables.sql:

#
# Table structure for table 'tx_news_domain_model_category'
#
CREATE TABLE tx_news_domain_model_category (
    uid int(11) NOT NULL auto_increment,
    pid int(11) DEFAULT '0' NOT NULL,
    tstamp int(11) DEFAULT '0' NOT NULL,
    crdate int(11) DEFAULT '0' NOT NULL,
    cruser_id int(11) DEFAULT '0' NOT NULL,
    sys_language_uid int(11) DEFAULT '0' NOT NULL,
    l10n_parent int(11) DEFAULT '0' NOT NULL,
    l10n_diffsource mediumtext,
    sorting int(11) DEFAULT '0' NOT NULL,
    deleted tinyint(4) DEFAULT '0' NOT NULL,
    hidden tinyint(4) DEFAULT '0' NOT NULL,
    starttime int(11) DEFAULT '0' NOT NULL,
    endtime int(11) DEFAULT '0' NOT NULL,
    fe_group varchar(100) DEFAULT '0' NOT NULL,
    title tinytext,
    description text,
    image text,
    parentcategory int(11) DEFAULT '0' NOT NULL,
    single_pid int(11) unsigned DEFAULT '0' NOT NULL,
    shortcut int(11) DEFAULT '0' NOT NULL,
    import_id varchar(100) DEFAULT '' NOT NULL,
    import_source varchar(100) DEFAULT '' NOT NULL,
    is_dummy_record tinyint(1) unsigned DEFAULT '0' NOT NULL,

    PRIMARY KEY (uid),
    KEY parent (pid),
    KEY parentcategory (parentcategory),
    KEY import (import_id,import_source)
);

The message went away.
After doing that and adding a news item, when I try to list the items on the backend I get this error:

#1: PHP Warning: Division by zero in /var/www/typo3_src-6.2.3/typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/Controller/PaginateController.php line 65 (More information)

TYPO3\CMS\Core\Error\Exception thrown in file
/var/www/typo3_src-6.2.3/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 111.

54 TYPO3\CMS\Core\Error\ErrorHandler::handleError(2, "Division by zero", "/var/www/typo3_src-6.2.3/typo3/sysext/fluid/Classe…elpers/Be/Widget/Controller/PaginateController.php", 65, array)

/var/www/typo3_src-6.2.3/typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/Controller/PaginateController.php:

00063:   \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->configuration, $this->widgetConfiguration['configuration'], FALSE);
00064:   $this->numberOfObjects = count($this->objects);

00065:   $this->numberOfPages = ceil($this->numberOfObjects / (int)$this->configuration['itemsPerPage']);

00066:  }
00067: 
...

categories+pagination+realURL

I have a listview and a cetegory menu above. When I click on a category in menu the URL looks like domain.de/newscategory/1/. The listview is shown filtered by that category. But when I change to site 2 in pagination widget the category is not in my link anymore and looks like domain.de/?tx_news_pi1%5B%40widget_0%5D%5BcurrentPage%5D=2&cHash=

My realURL config is like this:
'postVarSets' => array(
'_DEFAULT' => array(
// tx_news
'news' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
),
array(
'GETvar' => 'tx_news_pi1[controller]',
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
),
),
),
'newscategory' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_category',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
),
),

When I use the realURL config like https://docs.typo3.org/typo3cms/extensions/news/AdministratorManual/BestPractice/Realurl/Index.html no category is in my URL. That does not work.

What is wrong with my realURL configuration?

TYPO3 7.6.4
news 4.2.1
realURL 1.3.15

Multilanguage Wrong Fal Images/Downloads

Hey,
on a multiple language project, with split language folders, I cant get the right FAL images/downloads on the second language.
I see the images in the backend news list object, but not in the frontend. If I look up the entry in the DB (sys_file_reference) i see "0" in the row sys_language_uid.

Wrong translation with realurl by LinkViewHelper.php

Following constellation is set in my TYPO3 Website, which uses realurl:

sys_language_uid = 0 (default) is english
sys_language_uid = 1 is german

News are english as default and translated in german an referencing to original english news-

RealURL is:

'preVars' => array(
  array(
    'GETvar' => 'L',
    'valueMap' => array(
      'en' => 0
    ),
    'noMatch' => 'bypass'
  ),
),

This results in:

German website URL --> www.example.de/news/title-of-example-news/
English website URL --> www.example.de/en/news/title-of-example-news/

But the german website URL should look like www.example.de/news/titel-der-beispiel-nachricht/

I found out that a little change in LinkViewHelper.php row 161 fixed this issue:

OLD:
$configuration['additionalParams'] .= '&tx_news_pi1[news]=' . $this->getNewsId($newsItem);

NEW:
$configuration['additionalParams'] .= '&L=' . $GLOBALS['TSFE']->sys_language_uid . '&tx_news_pi1[news]=' . $this->getNewsId($newsItem);

Could you please check this behavior. Thank you

Choosen categories are not shown in the plugin

Hello,

when I choose one or more categories as a filter in the plugin, they are stored and they semm to work correctly in the frontend. In the page view (backend layout) I can see the categories too. But when I reopen the plugin in the BE no checkbox is set.

In other content elements the syscategory selection works fine.

Any ideas what is wrong?

Best,

Holger

overwriteDemand year/month does not work when eventnews is installed

Both news and eventnews are installed.

When accessing archived news from 'date menu' archived news can be displayed in a list view, ordered by year and month. Each month shows the number of the archived news as a link. This link is like:
?id=archiv_artikel_mon&tx_news_pi1[overwriteDemand][year]=2015&tx_news_pi1[overwriteDemand][month]=11&tx_news_pi1[...]

By a click at one month, the news of all years and all month are displayed.

If eventnews is disabled or removed, only the archived news oft the selectet month are displayed, which is the expected behavior.

TtContentRelation updatescript doesn't migrate all mm relations from news to tt_content

Reproducing this issue

  • Use content element relation
  • Add a new news record with content element relation in TYPO3 6.2 with news version 3.1.0
  • Make a copy of this news record (the content element id will be the same!!! this is different in TYPO3 7.6 with news 4.2.1)
  • Migratie it to TYPO3 7.6 with news version 4.2.1 and use the update script in the install tool (with news 3.2.0 changes relation from mm table to tx_news_related_news field in tt_content)

There will be some relations lost from news records to content elements, so some content elements will not be shown

Fix
Extend the update script TtContentRelation.php > performUpdate:
If there are more relations to the same content element, copy this content element

Advanced search ?

Hi,
Does anyone tried to make an extension for advanced search? For example to search by phrase, category and year at the same time? Where can we read about this? I broke my eyes trying to find information or tutorials about this - still nothing...

Is a way to sort by keywords ?

Greets,

Is there a way to sort by keywords using tx_news ?
We have switched from tt_news to tx_news and we were using the view "Only relation by keyword".

Thanks,

Localized categories - not work, not output on the page.

Hello, all!

I have problem. I have a localized news category but they not output on the page "No categories available.".

[DE] Default language - work, output on the page.
[EN] Second language - not work, not output on the page.

TYPO3 6.2.4
EXT: news 3.1.0 dev

Need your help.

2014-09-17_200258

Problem selecting categories for editor accounts

As long as you are not admin but an editor linked to a certain usergroup (with access rights already set up), category mounts do not work as they should.

If I have 2 categories, cat1 and cat2, and 2 subcategories for cat1, subcat1a and subcat1b, I should normally only select cat1 and cat2 as accessible in the "category mountpoints" section but still be able to assign subcat1a and subcat1b to my news. The subcategories are all visible if I choose their parents as mountpoints, but I cannot attach these subcategories to the news unless I also mark them as mountpoints.
The problem is that when the subcategories are also setup as mountpoints, they show up 2 times, in the parent's tree and also one more time in the main tree line.

See attached image for a description of the problem
category_mountpoints

I think the issue is in the class AccessControlService.php in the method getAccessDeniedCategories.

        $backendUserCategories = $backendUserAuthentication->getCategoryMountPoints();
        $newsRecordCategories = self::getCategoriesForNewsRecord($newsRecord);

        // Remove categories the user has access to
        foreach ($newsRecordCategories as $key => $newsRecordCategory) {
            if (in_array($newsRecordCategory['uid'], $backendUserCategories)) {
                unset($newsRecordCategories[$key]);
            }
        }

        return $newsRecordCategories;

Here you should check if a $newsRecordCategory is also a child of a $backendUserCategories mountpoint category because in_array will only do a direct uid match, and it will only compare categories which are on the same level.

Thank you

Media Field doesn't allow MP3 files

Please add MP3 as allowed media file. Already allowed: "gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,flv,mp4"

Configuration/TCA/tx_news_domain_model_news.php, Line 778

$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] . ',flv,mp4,mp3'

For now I added this to my extTables.php:

$filetypes = $GLOBALS['TCA']['tx_news_domain_model_news']['columns']['fal_media']['config']['foreign_selector_fieldTcaOverride']['config']['appearance']['elementBrowserAllowed'];
$GLOBALS['TCA']['tx_news_domain_model_news']['columns']['fal_media']['config']['foreign_selector_fieldTcaOverride']['config']['appearance']['elementBrowserAllowed'] = $filetypes . ',mp3';

Problem 'news' category with 'realurl'

I have problem output title of category in URL.

Category:

  • Title 1
  • Title 2

Writed:

'cat' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_category',
'id_field' => 'uid',
'alias_field' => 'coalesce(NULLIF(description, ""), title)',
//'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
)

Output:

'/cat/Title 1/' - wrong

... correctly - '/cat/title-1/'

Need your help.

Use statement causes Fatal Error while cleanup with lowlevel_cleaner

I tried to clean up TYPO3 withe the cli command

php /srv/www/typo3/cli_dispatch.phpsh lowlevel_cleaner missing_files -r --refindex update --AUTOFIX

When the auto correction starts, the following Fatal Error was thrown:

PHP Fatal error:  Cannot use TYPO3\CMS\Backend\Utility\BackendUtility as BackendUtility because the name is already in use in /srv/www/typo3conf/ext/news/Classes/Hooks/DataHandler.php on line 18

Maybe one should use an alias for this class import. I tried to use it the following way and everything runs smoothly:

use TYPO3\CMS\Backend\Utility\BackendUtility as NewsBackendUtility;

Of cause I've replaced all calls of BackendUtility by NewsBackendUtility. I choose NewsBackendUtility, because "News" seems to be a unique prefix.

I'm using TYPO3 6.2.14 and PHP 5.6.8.

Kind regards
Andi

SimplePrevNextViewHelper gives error if number of items is 0

Without the test added below an error occurs if the number of news in the storage equals 1.

protected function mapResultToObjects(array $result) {
        $out = $tmp = array();
        $count = count($result);

        if($count > 0) {
            switch ($count) {
                case 3:
                    $tmp['prev'] = $result[0];
                    $tmp['next'] = $result[2];
                    break;
                case 2:
                    $tmp['prev'] = $result[0];
                    break;
                case 1:
                    $tmp['next'] = $result[0];
                    break;
                default:
                    throw new \UnexpectedValueException(sprintf('Unexpected count of "%s" which is not implemented!', $count));
            }

            foreach ($tmp as $_id => $single) {
                $out[$_id] = $this->getObject($single['uid']);
            }
        }

        return $out;
    }

Tags and RealUrl Pagination

The pagination ist lost the tx_news_pi1[overwriteDemand][tags] parameter, when selected unsing the realurl configuration from the document.

The first page shows all news with the tag "news"
/tags/test/

clicking the next page looks like and all news a shown:
/tags//page/1

Installation:
TYPO3 7.6.2
news 4.0.0
bootstrap_package 7.0.0-dev

How can I show a image of category?

Writed: {category.item.images}

Received error:
Cannot cast object of type "TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage" to string.

Writed:
<f:for each="{category.item.images}" as="image"> {image} </f:for>
Received: Tx_News_Domain_Model_FileReference:1

And then, what to do, not know.

Need your help.

Migration Wizard TtContentRelation is still shown.

If checkForUpdate return true, the migration runs smoothly and return TRUE as status.

So far so good.

However, checkForUpdate will still return true and attempt to migrate again, and again, and again.

The function performUpdate should remove the old tx_news_domain_model_news_ttcontent_mm records upon successfully migrating.

Run FalUpdateWizard manually

I recently updated TYPO3 from 4.7.x to 6.2.x
Everything worked fine, but i can only use the news extension switchting Use FAL relations instead of news media elements [records.useFal] to "both". I have lots of images, but they are not migrated to FAL. How can i manually run the UpdateTask again?

Thank you.

Core: Error handler (BE)

Hi,
I am using
Typo3 7.6.4
news 4.2.1
eventnews 1.1.0
Everything seems to work but I get a lot of messages in the protocoll like:
Core: Error handler (BE): PHP Warning: Declaration of GeorgRinger\Eventnews\Hooks\BackendUtility::updateFlexforms(&$params, &$reference) should be compatible with GeorgRinger\News\Hooks\BackendUtility::updateFlexforms(array &$dataStructure, array $row) in /var/www/vhosts/......../typo3conf/ext/eventnews/Classes/Hooks/BackendUtility.php line 51

Do you know about this and is there already a fix for it?
Best regards,
Jürgen

Time limit

Hi,

Not a issue but a request :)
It'll be cool that "time limit" can limit news for the current "date" only, without time.
Like "news/event for today".
Limiting with "-1 day" and "+1 day" take care of hours, so it's achieved correctly only if next/prev news are exactly 24h out of current time.

Is it possible ?
BTW, Thx for the great work !

Sylvain

Content of <title> tag is no more news title

Hi,
with b548fa7 the content of the title tag of the detail of a news is no more the news title itself.

I'm in the TYPO3 6.2 branch and PageGenerator uses $GLOBALS['TSFE']->altPageTitle
while in class TitleTagViewHelper the one set is $GLOBALS['TSFE']->page['altPageTitle']
maybe here is the problem.

Bye!

FileReference::setOriginalResource problem on environment with PHP7

When using 4.1 version on a system with PHP 7, on a pages that contain news plugins we can see often this error:

Oops, an error occurred!

PHP Warning: Declaration of TYPO3\CMS\Extbase\Domain\Model\FileReference::setOriginalResource(TYPO3\CMS\Core\Resource\FileReference $originalResource) should be compatible with TYPO3\CMS\Extbase\Domain\Model\AbstractFileFolder::setOriginalResource(TYPO3\CMS\Core\Resource\ResourceInterface $originalResource) in /var/www/web.local/typo3/sysext/extbase/Classes/Domain/Model/FileReference.php line 22

We can flush caches and this page starts to work, but if we switch to different url that contains news plugin this error will exist there. Again we can flush caches and reload this page and it will fix it here, but break on other pages with news plugins.

news plugin: no possibility to set time limit high AND low

Hi there,

there's no possibility to set time restriction higher than AND lower than given time in the news plugin. I want to display a datemenu und listview of news higher than 2000, but lower than 2015. Is that maybe possible and i missed something?

Thanks in advance!

news: 4.0.0
TYPO3: 7.6.3-dev

Cached newsplugin list view does not respect start and endtime of news without further configuration

Start and end time of news entries are not respected in expiration time of cached pages with newsplugins with list view without further configuration.

Example:
If a news has an expiration date of today 12:00 o'clock, but a cache entry for the page was created at 10:00 o'clock, the news is still displayed in the list at 13:00 o'clock, if the cache was not flushed through other means.

Is there a reason why the list view does not modify the cache config automatically to notify the frontend controller that the current page depends on news entries? Similar to the function GeorgRinger\News\Utility::addPageCacheTagsByDemandObject() a helper could be used to set the following dependent on pageid and storageids.

GLOBALS['TSFE']->config['config']['cache.']['PAGEID'] = 'tx_news_domain_model_news:STORAGEID'

This would be used by TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getCurrentPageCacheConfiguration() and TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getFirstTimeValueForRecord() to determine the expiration time.

Otherwise I could implement the above and provide a pull request.

Error News Recycler Undelete broken for nonAdmins and Fix

Error News Recycler Undelete broken for nonAdmins and Fix

Case:

  • Editors (nonAdmins) with all rights on all NewsRecord-Types and Global Categories
  • Editors have Web Recycler Module (Core) to restore deleted Records.
  • Editors have not yet added any Categories
  • Editor adds News1 in Sysfolder (without any Category-Relation)
  • Editor deletes News1 in Sysfolder
  • Editor uses Recycler to check for deleted records and finds News1
  • Editor selects News1, and Clicks Button Undelete
    and confirms the Dialog: "Undelete records from tables: tx_news_domain_model_news Are you Sure?"
    with OK and gets the following ERROR:

Uncaught TYPO3 Exception
#1: PHP Catchable Fatal Error: Argument 1 passed to GeorgRinger\News\Service\AccessControlService::userHasCategoryPermissionsForRecord() must be of the type array, null given, called in /srv/www/www/typo3conf/ext/news/Classes/Hooks/DataHandler.php on line 157 and defined in /srv/www/www/typo3conf/ext/news/Classes/Service/AccessControlService.php line 35 (More information)

  • Stacktrace see below (the print_r is mine ;-)
  • Reason seems to be that $newsRecord = BackendUtilityCore::getRecord($table, $id); wont return the right value.
  • However it seems superflous to me that the
    function processCmdmap_preProcess
    which is supposed to:
    • Prevent deleting/moving of a news record if the editor doesn't have access to all categories of the news record
      also tries to take care of an Undelete-Action.

Thus my simple bugfix is to exclude the undelete-command from those checks in:
news/Classes/Hooks/DataHandler.php:153
public function processCmdmap_preProcess($command, &$table, $id, $value, $parentObject) {
// if ($table === 'tx_news_domain_model_news' && !$this->getBackendUser()->isAdmin() && is_integer($id)) {
if ($table === 'tx_news_domain_model_news' && $command != 'undelete' && !$this->getBackendUser()->isAdmin() && is_integer($id)) {

Please review and feedback;
Thanks Georg

Stacktrace
10 TYPO3\CMS\Core\Error\ErrorHandler::handleError(4096, "Argument 1 passed to GeorgRinger\News\Service\Acce…sses/Hooks/DataHandler.php on line 157 and defined", "/srv/www/www/typo3conf/ext/news/Classes/Service/AccessControlService.php", 35, array)

/srv/www/www/typo3conf/ext/news/Classes/Service/AccessControlService.php:
00033: * @return boolean
00034: */
00035: public static function userHasCategoryPermissionsForRecord(array $newsRecord) {
00036: if (!EmConfiguration::getSettings()->getCategoryBeGroupTceFormsRestriction()) {
00037: return TRUE;

9 GeorgRinger\News\Service\AccessControlService::userHasCategoryPermissionsForRecord(NULL)

/srv/www/www/typo3conf/ext/news/Classes/Hooks/DataHandler.php:
00155: $newsRecord = BackendUtilityCore::getRecord($table, $id);
00156: print_r($newsRecord);
00157: if (!AccessControlService::userHasCategoryPermissionsForRecord($newsRecord)) {
00158: $parentObject->log($table, $id, 2, 0, 1, "processCmdmap: Attempt to " . $command . " a record from table '%s' without permission. Reason: the record has one or more categories assigned that are not defined in the BE usergroup.", 1, array($table));
00159: // unset table to prevent saving

8 GeorgRinger\News\Hooks\DataHandler::processCmdmap_preProcess("undelete", "tx_news_domain_model_news", 14, 1, TYPO3\CMS\Core\DataHandling\DataHandler, boolean)

/srv/www/www/typo3_src/typo3/sysext/core/Classes/DataHandling/DataHandler.php:
02995: foreach ($hookObjectsArr as $hookObj) {
02996: if (method_exists($hookObj, 'processCmdmap_preProcess')) {
02997: $hookObj->processCmdmap_preProcess($command, $table, $id, $value, $this, $pasteUpdate);
02998: }
02999: }

7 TYPO3\CMS\Core\DataHandling\DataHandler::process_cmdmap()

/srv/www/www/typo3_src/typo3/sysext/recycler/Classes/Domain/Model/DeletedRecords.php:
00323: $tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\DataHandling\DataHandler');
00324: $tce->start(array(), $cmd);
00325: $tce->process_cmdmap();
00326: $result = TRUE;
00327: }

6 TYPO3\CMS\Recycler\Domain\Model\DeletedRecords::undeleteData("[["tx_news_domain_model_news",14]]", "false")

/srv/www/www/typo3_src/typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php:
00111: $recursive = GeneralUtility::_GP('recursive');
00112: $model = GeneralUtility::makeInstance('TYPO3\CMS\Recycler\Domain\Model\DeletedRecords');
00113: if ($model->undeleteData($this->data, $recursive)) {
00114: $str = TRUE;
00115: }

5 TYPO3\CMS\Recycler\Controller\RecyclerAjaxController::createContent()

/srv/www/www/typo3_src/typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php:
00072: }
00073: // Create content
00074: $this->createContent();
00075: }
00076:

4 TYPO3\CMS\Recycler\Controller\RecyclerAjaxController::mapCommand()

/srv/www/www/typo3_src/typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php:
00054: */
00055: public function init() {
00056: $this->mapCommand();
00057: $this->getContent();
00058: }

3 TYPO3\CMS\Recycler\Controller\RecyclerAjaxController::init(array, TYPO3\CMS\Core\Http\AjaxRequestHandler)
2 call_user_func_array(array, array)

/srv/www/www/typo3_src/typo3/sysext/core/Classes/Utility/GeneralUtility.php:
04296: }
04297: // Call method:
04298: $content = call_user_func_array(array(&$classObj, $parts[1]), array(&$params, &$ref));
04299: } else {
04300: $errorMsg = 'No method name '' . $parts[1] . '' in class ' . $parts[0];

1 TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction("TYPO3\CMS\Recycler\Controller\RecyclerAjaxController->init", array, TYPO3\CMS\Core\Http\AjaxRequestHandler, boolean, boolean)

/srv/www/www/typo3_src/typo3/ajax.php:
00078: // Cleanup global variable space
00079: unset($csrfTokenCheck, $ajaxRegistryEntry, $tokenIsValid, $success);
00080: $success = \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($ajaxScript, $ajaxParams, $ajaxObj, FALSE, TRUE);
00081: } else {
00082: $ajaxObj->setError('Invalid CSRF token detected for ajaxID "' . $ajaxID . '"!');

"Show in preview views" checkbox in duplicating itself in BE...

show in preview views - twice

Please advice how to fix this duplicating checkboxes «Show in preview views». It appeared suddenly, without any changes in the source code of news ext. By the way, clicking on any of it, or even on both at the same time doesn’t save «Show in preview views» state after saving page in BE…

500 server error

Updating the news extension from version 3.1.0 to 3.2.4 results in a 500 server error - even for the backend.

PHP version on the server is 5.4.3. Could that be the problem?

-Andrea

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.