Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
CTools adds its own pre_render for all of core's form elements, which let's #dependency do its job with no extra work.
Let's do this for the date element!
Comment | File | Size | Author |
---|---|---|---|
#24 | date-n1177198-24.patch | 769 bytes | DamienMcKenna |
#22 | date-n1177198-22.patch | 715 bytes | DamienMcKenna |
| |||
#14 | date-1177198-14.patch | 769 bytes | MustangGB |
#10 | date-1177198-10-NOCODINGSTANDARDSFIXES.patch | 3.57 KB | tim.plunkett |
#10 | date-1177198-10.patch | 4.53 KB | tim.plunkett |
Comments
Comment #1
tim.plunkettAttached.
Comment #2
tim.plunkettUh, sorry. Forgot date was from core, so patch filed here: #1177220: Expand coverage of ctools_dependent_pre_render
Still, here's a patch for the various elements provided by the date modules.
Comment #3
KarenS CreditAttribution: KarenS commentedI have no problem with this conceptually, just trying to understand what it will do. Can you explain what this will accomplish?
Comment #4
tim.plunkettViews still uses ctools's dependency system instead of #states. Within Views, to show another input only when a date is set to a given value, it needs to use this #pre_render callback.
Comment #5
KarenS CreditAttribution: KarenS commentedOK, looks fine to me.
Comment #6
arlinsandbulte CreditAttribution: arlinsandbulte commentedpatch no longer applies
Comment #7
tim.plunkettI'm surprised git wasn't smart enough to figure that out.
Here's a reroll.
Comment #8
arlinsandbulte CreditAttribution: arlinsandbulte commentedSorry, needs another reroll....
Comment #9
arlinsandbulte CreditAttribution: arlinsandbulte commentedAlso, I noticed a bunch of code style changes like this:
That only change the indentation of that bracket.
I am not very familiar with coding standards, but is that intentional?
Comment #10
tim.plunkettI normally don't try to fix coding standards in patches, but since I was modifying the code directly in that function, I figured it was reasonable. See http://drupal.org/coding-standards#array, the changes are valid.
However, in the interest of getting something committed, here are both patches.
Comment #11
arlinsandbulte CreditAttribution: arlinsandbulte commentedOK, thanks for the explanation. I'm ok with correcting the style at the same time. Just wanted to make sure and learn in the process.
Committed date-1177198-10.patch from #10.
http://drupalcode.org/project/date.git/commit/67cbfaf
Note:
I did not use git am because I wanted to update the changelog on the same commit.
Instead, I used git apply and then git commit --author='tim.plunkett'
Perhaps there is a way to use git am, edit the changelog, then modify the commit to include the changelog edit... all of this done locally, of course, and then pushed.
Is that possible?
Comment #12
tim.plunkett@arlinsandbulte, After git am, make more changes, then
git commit --amend
will add those into the previous commit, then you can push.EDIT: You should also research "git interactive rebase",
git rebase -i
, it's how you would combine unpushed commits that aren't sequential, among other things, and it is amazing. If you ever catch me on IRC, I'd be happy to walk you through it, or people in #drupal-gitsupport could explain it, or you can read about it online.Comment #14
MustangGB CreditAttribution: MustangGB commentedFollow-up to allow #dependency on filters.
Comment #15
MustangGB CreditAttribution: MustangGB commentedComment #16
DamienMcKennaI think this is ok.
Comment #22
DamienMcKennaRerolling.
Comment #23
DamienMcKennaBumping to 2.11.
Comment #24
DamienMcKennaRerolled.
Comment #25
DamienMcKennaCommitted. Thanks all.
Comment #27
MustangGB CreditAttribution: MustangGB commentedMuch appreciated.