Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
There are many examples throughout core and contrib, where some code wants to add some additional options, while keeping existing ones.
This can be cumbersome:
$query = $source_url->getOption('query');
$query['op'] = 'finish';
$query['id'] = $_batch['id'];
$source_url->setOption('query', $query);
Proposed resolution
What about adding some $url->mergeOptions()
method to easy this process.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff.txt | 528 bytes | dawehner |
#7 | 2844001-7.patch | 2.25 KB | dawehner |
#3 | 2844001-url_merge-3.patch | 2.16 KB | tim.plunkett |
#3 | 2844001-url_merge-3-interdiff.txt | 1.77 KB | tim.plunkett |
#2 | 2844001-2.patch | 1.1 KB | dawehner |
Comments
Comment #2
dawehnerHere is a test coverage as sort of a specification.
Comment #3
tim.plunkettThanks for the spec test, that helped when deciding which way to merge.
Comment #4
dawehnerSuper cool. Thank you @tim.plunkett!
+1 for this line of documentation.
Nice, to have this method being used!
Comment #6
alexpottThe additional functionality should have a change record.
Perhaps we want another called to ->setOptions() to prove is it destructive on the original options.
Comment #7
dawehnerSure, why not.
Working on a CR now.
Comment #8
dawehnerThere is a change record now.
Comment #9
alexpottCommitted b1500e0 and pushed to 8.3.x. Thanks!
My 7000th commit :)