Review main Abandoned

52191[BUGFIX] Allow click-menu items before RecordProvider's

Thomas Hohn CR 0 V 0 Easy +46 −4 updated 04/04/17, 07:05

Commit message

This patch makes it possible to add items to the click-menu
with a higher priority than the RecordProvider's without
loosing the items with a priority lower than this.

It was possible to configure this in TYPO3 7.6 and it
makes sense to keep this behaviour in order to make
it possible to have custom actions above the RecordProvider's.
This can be achieved by giving a priority higher than 60
and add a call to disableRecordProviderAsFallback which
disables that the RecordProvider is used as fallback and
avoid that it performs an early return.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 2

Review log 1013

  1. Thomas Hohn uploaded patch set 1 03/27/17, 17:02

  2. TYPO3com voted on patch set 1 V +1 03/27/17, 17:10 Completed build in 08m 25s on Mon, 27 Mar, 07:10 PM Test Summary: 56517 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9670

  3. Tymoteusz Motylewski commented on patch set 1 CR -2 03/27/17, 20:18

    This was intentionaly implemented like that. What is your use case?
  4. Thomas Hohn uploaded patch set 2 03/28/17, 09:26

  5. TYPO3com voted on patch set 2 V +1 03/28/17, 09:36 Completed build in 09m 25s on Tue, 28 Mar, 11:36 AM Test Summary: 56519 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9736

  6. Anders Kostending voted on patch set 2 CR +1 03/28/17, 09:55

  7. Faton Haliti voted on patch set 2 CR +1 03/28/17, 10:21

  8. Thomas Hohn updated the commit message in patch set 3 03/28/17, 11:37

  9. TYPO3com voted on patch set 3 V +1 03/28/17, 11:52 Completed build in 14m 56s on Tue, 28 Mar, 01:52 PM Test Summary: 56519 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9764

  10. Benni Mack commented on patch set 3 03/28/17, 22:07

    I don't think changing the API in this way is the way to go for a quite uncommon case like you describe. Adding an item can be done by a hook with doing an array_shift($items, $myItem) on top. So, it is possible. The functionality you describe sounds more like what TYPO3 does with services. Services are like "nothing matched," something matched but go ahead" and "something matched, stop right now". Right? What to do with this patch now?
  11. Thomas Hohn commented on patch set 3 03/29/17, 04:13

    Hi My original patch was to change the RecordProvider to just return $this->initialize(); $items += $this->prepareItems($this->itemsConfiguration); return $items; Which still IMO is the correct solution. I don't see its a rare use-case that you want your items for your table to be at top and still have the record editing facilities etc. instead that your users should "scroll" to the bottom and then execute the action. Instead the API treats a higher priority by just applying these items and discard that rest by the early return in the RecordProvider. From the documentation I read no where that I have to extend the RecordProvider and handle it with some "black-magic" to achieve this goal. If Patchset1 can't be accepted - I suggest it would at least be nice to have this example in the documentation - can't believe I'm the only person with that wish? So there are IMO tho scenarios: 1) Accept Patchset1 2) Abandon patch and update documentation with more examples
  12. Tymoteusz Motylewski commented on patch set 3 04/01/17, 19:28

    You don't have to inherit from RecordProvider. You can of course if you find it useful for your purposes. However the common scenario is that extension wants to add one item to the list of existing items. And this is easily solvable with provider which inherits from abstract provider. In the real life it is more common to insert element after or before another existing element than on top or on the bottom of the whole list. because usually we want to group items somehow. So you will not be able to just use priority to achieve correct order of items. If you see the need to improve the docs, please send a pull request on github.
  13. Thomas Hohn abandoned the change 04/04/17, 07:05

    Can be solved otherwise