CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Feature #34847

Add news record uid(s) to constraints for list action

Added by Steffen Müller about 1 year ago. Updated 5 months ago.

Status:Closed Start date:2012-03-14
Priority:Could have Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
TYPO3 Version:4.5 Has patch:No
PHP Version: Complexity:
Votes: 0

Description

I'd like to explicitly set the uids of news items for the list action using constraints/overrideDemand.

My usecase is:
Editors choose a number of news items for a newsletter page (directmail).

This is rather an edge case, so I wouldn't add the whole functionality to news extension, but create a separate extension.

My solution would be to:
a) Create an extension with a plugin (extra plugin is needed because of permission requirement)
b) Plugin comes with a simple flexform with a single group/db form field to select news items)
c) Plugin calls a ControllerAction which forwards to listAction of news extension. The list of uids from FlexForm settings are put into overrideDemand arguments.

Do you think this new constraint could be generally useful?

History

Updated by Georg Ringer about 1 year ago

  • Priority changed from Should have to Could have

Hi,

IMO this shouldn't go into EXT:news as this constraint would be never used inside the extension itself.

However with master you can extend any class, also the repository, so this should be no big deal to extend this functionality too.

Updated by Steffen Müller about 1 year ago

Sounds reasonable.

The related code I found was f43d7692e
Is this proof-of-concept or already a stable API?
Are there some unit tests around?

The conventions seem to be:

Config: Resources/Private/extend-news.txt 
Shipping code in: Classes/_ClassNameToExtend_.php
Saving cached class in static file cache typo3temp/Cache/Code/cache_phpcode/

Not sure if this is the optimal solution.
What about yaml config in Configuration/News/ClassBuilder.yaml like in extension builder? This config could also contain a path to custom classes, so no fixed path would be used.

Updated by Georg Ringer about 1 year ago

it is that awesome that it is stable and proof of concept at the same ;)

i tested it and it works, however for sure it can be improved like checking for duplicate functions/properties. however the api will stay the same and would be happy to get some more tests, yeah unit tests would be of course nice too

Updated by Steffen Müller about 1 year ago

To be honest, I don't like the actual way of configuration:
  • Arguments in extend-news.txt are neither classnames nor filepath.
  • Filepaths are not configurable, collisions of origin and extension classes could happen, even if class namespace is different

What do you think about my suggestion to use yaml? like it is done in Extension Builder

Updated by Georg Ringer about 1 year ago

it can be for sure improved

Updated by Georg Ringer 5 months ago

  • Status changed from New to Closed

nothing to do here within this issue

Also available in: Atom PDF