Closed (fixed)
Project:
Calendar
Version:
6.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2009 at 22:42 UTC
Updated:
16 Jan 2011 at 20:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
merlinofchaos commentedThis is already fixed in -dev.
Also, active (needs more info) is used to indicate that the issue queue maintainers need info from the poster, so setting your issue to this status can cause it to be ignored.
Comment #2
kcolbe commentedThanks for your help. I cleared my cache, uninstalled the old views (using uninstall then removing the views dir), rebuilt menus (not that I think I'd have to for this), then updated to the latest dev version of views...but I still have the same problem. Please see the attached screenshots. Thanks.
Comment #3
kcolbe commentedComment #4
merlinofchaos commentedWhat, you didn't think the fact that you're using a calendar style was relevant?
Especially with this in the release notes:
Please doublecheck this problem in a core Views style. If it doesn't appear there, then it's not a Views bug, and you should refile against calendar.
Comment #5
kcolbe commentedPlease see the above posts...
Comment #6
kcolbe commentedComment #7
kenorb commentedkcolbe: which version of PHP are you using?
Probably duplicate of: #442768: Replacement pattern [nid] doesn't work on PHP4
Comment #8
kcolbe commentedIm using 5.2.6
Comment #9
iva2k commentedI've encountered exactly the same issue as original post -
I see a field disappears from output by replacement patterns if is checked "Exclude from display" with all the latest -dev versions:
Calendar 6.x-2.x-dev 2009-Jul-29
Views 6.x-2.x-dev 2009-Jul-27
Token 6.x-1.x-dev 2009-Jul-21
PHP 5.2.9
MySQL 5.0.67
Reopening. Also, raising priority because it makes calendar.module 99% useless for any of my sites.
Comment #10
iva2k commentedPatch is attached against Calendar 6.x-2.x-dev 2009-Jul-29.
I traced the problem to function template_preprocess_calendar() in theme/theme.inc. It erases the 'exclude'd field on the first pass through the fields. That makes the field not available for the subsequent replacement patterns in other fields. The patch changes it to two-pass, with 'exclude' in the second pass.
That fixes the problem for me. Please review for commit to -dev.
Comment #11
iva2k commentedI was uneasy about #1 by merlinofchaos, stating that it was already fixed in -dev, so I kept looking at the code in question, trying to understand why the fix I did actually makes a difference.
I noticed that there is a call to drupal_clone() used to create $copy that is passed to $field->theme($copy). I recognize the intent to operate on object's copy, so unset() that is called on the target 'exclude'd field will not affect pattern replacement. Should be working without my patch... Hm.
However, I followed into drupal_clone(), which in turn calls PHP 5 clone. Its doc page mentions (see http://us3.php.net/clone) "When an object is cloned, PHP 5 will perform a shallow copy of all of the object's properties. Any properties that are references to other variables, will remain references.". Maybe that was the culprit of the original code not working. If the fields are references, then unsetting it may affect the original.
I didn't have enough time to dig into that too much, but I can re-confirm the fact that the above patch indeed fixes the problem. If I remove the patch, the problem returns.
Comment #12
marcushenningsen commentedThe patch works for me. Thanks a lot.
For clarification (at least I didn't get that at first), the patch is to be applied against theme.inc in the mentioned calendar package.
Comment #13
zoen commentedThis patch works for me, and I need it. :-) Nice work, iva2k.
Comment #14
felipe commentedConfirmed too. Patch #10 works.
Comment #15
pyzahl commentedgreat... #10 works also for me :-) Thank you so much!
Comment #16
arlinsandbulte commentedNote: Marked #540388: rewrite fields do not show if field is set to exclude as a duplicate of this issue
Comment #17
twodI can also confirm the #10 patch works.
Comment #18
mentat.fr commentedI confirm too, the #10 patch work for me, please integrate it on the release/dev.
many thanks iva2k.
Comment #19
mysterlune commentedThanks a million, iva2k. I appreciate the research into php5's object cloning behavior.
The patch at #10 does the trick for me (using Calendar 6.x-2.2 release).
Comment #20
iva2k commentednag nag
Comment #21
mbakunas commentedAlso can confirm that patch in #10 works.
Comment #22
yan commentedSame problem, #10 works. Thanks!
Comment #23
maddentim commented#10 Worked here.
Comment #24
renenee commentedworked for me
Comment #25
Anonymous (not verified) commented#10 works and is pretty critical! What more needs to be done to get it in the dev version?
Comment #26
joachim commentedPatch works for me.
Please commit!
Comment #27
dawehnerWorks fine for me, too.
Comment #28
ricenoodles commentedsubscribing
Comment #29
edonnelly commentedsubscribing
Comment #30
dmcmeans commentedsubscribing
Comment #31
kenorb commentedComment #32
arlinsandbulte commentedAccording to http://drupal.org/node/156119, "patch (to be ported)" has the following defenition:
So to be marked "patch (to be ported)," the patch first must be committed to the 6.x-2.x-dev branch.
THEN, if there is interest in applying the same patch to another branch (like the 5.x-2.x-dev or 7.x-1.x-dev) it should be marked as "patch (to be ported)"
Comment #33
edonnelly commentedPatch #10 was against an older -dev (2009-Jul-29.) version. Does anyone know if it works against the current -dev (2010-Aug-22) ?
Comment #34
llslim commentedComment #35
llslim commentedSorry but my comment didn't post with #34. So here is the message...
Patch #10 works against the current calendar-6.x-2.x-dev (2010-Aug-22) file but had a redundant foreach loop at end. The conditions just needed to be rearranged with in the same foreach. Attached is the updated version of the patch in #10 for review and verification.
Comment #36
mr.andrey commentedsubscribing...
Comment #37
Saiboth commented[#34] works for me and is very helpful. Please submit to the main code line!
Comment #38
mariomc commented[34] works for me as well and is very helpful too.
I'd also like to see this commited to the main code line.
Thank your for you work!
Comment #39
peter törnstrand commented#34 works for me too.
Comment #40
potassiumchloride commented[34] This patch worked for me, but it seemed to re-create this issue: https://drupal.org/node/575532. Now that I have added the Node ID to the view (excluded from display but used in rewriting the output as a link to event/[nid]), I only have one event appearing per month. Anyone else have this problem?
Comment #41
karens commentedI committed #34. Please start a followup issue if there is some problem with using nid.
Comment #43
carvalhar commented#34 working fine for me and i didn't had the bug of #40.
definitely it should be applied.
thanks