Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
views.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Nov 2013 at 19:07 UTC
Updated:
16 Feb 2015 at 12:34 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
dawehnerThere is at least one more bug hidden:
Thank you for providing that report!
Comment #2
balazswmann commentedI can confirm this bug. It still exists in the 8.x branch.
Comment #3
balazswmann commentedI have attached a patch to fix the undefined index PHP notice.
Comment #4
jhedstromComment #5
tadityar commentedRe-rolled the patch.
Comment #6
tadityar commentedI also think that
is not necessary, so I didn't include that in #5 patch.
(It only change indentation).
Comment #8
lokapujyaThat change did more than just indentation, it moved the if statement inside of the other if statement.
Comment #9
tadityar commentedYes that did.. didn't notice that, thanks! Re-rolling now.
Comment #11
tadityar commentedTrying again.
Comment #13
lokapujyaShould keep String:checkPlain().
Comment #14
tadityar commentedComment #15
jhedstromI've updated the issue summary with steps to reproduce, and a beta-phase evaluation. I've confirmed the patch in #13 removes the notice. RTBC I think.
Comment #16
jhedstromComment #17
alexpottWe should have a test for this.
Comment #18
jhedstromI spent a bit of time trying to get
Drupal\user\Tests\Views\HandlerFieldUserNameTestto throw this notice, but something in how that code is being tested bypasses the PHP notice. I'll revisit if I get a chance.Comment #19
jhedstromHere's the issue: Since the test view
test_views_handler_field_usern_namehas certain defaults, the variousinit()methods in the test are setting theadditional_fieldsparameter, which when set, avoids the PHP notice. Manually toggling these settings during the course of a test doesn't unset those from the field handler.Therefore, the test for this can either change the defaults in the existing test view, or add a new test view. Changing the defaults to false (format_username, overwrite_anonymous, and link_to_user) breaks some current tests, but definitely throws the php notice.
Comment #20
jhedstromHere's a test. As mentioned above, I needed to rework the default settings of the existing user name field handler view, thus the changes to the current test.
Comment #22
lokapujyaTest looks good.
Comment #23
olli commentedApplied the patch, edited the people view, checked "Overwrite the value to display for anonymous users" and set "Text to display for anonymous users" to "visitor". Went to admin/people and see "visitor" instead of "admin".
Comment #24
lendudeThis line....
Needs this to be set.
That leads to the problem in #23.
Updated patch in #20 to account for this.
Comment #26
lendudeWell that undid the original fix, so that doesn't help much :) Back to the drawing board.....
Comment #27
lendudeLet's try this again....
Comment #28
jhedstromGiven #23 I'm concerned that neither the new tests, nor existing tests, caught that. Perhaps a few more assertions are in order for better coverage around the anonymous username formatting?
Comment #29
lokapujyaTried something, but it's not working. I don't get it because it looks like the test already logs in a user, but it's supposed to be testing an anonymous user.
Comment #31
lokapujyaLast patch bad. this is what i tried.
Comment #32
lendudeLet's make the testbot do it's magic....
Comment #34
lokapujyaIn the previous patch, I tried to change the logged in user before executing the view; But, I didn't need that. What WAS needed is to show that overwrite anonymous doesn't affect a regular user's name. Here is a test-only patch against #20 to show the test failure. Plus, an interdiff, and the new patch.
Comment #36
lendudeFixes the issue and the issues in #17, #23 and #28 are addressed.
Comment #37
alexpottNice tests - thanks. Committed 4900170 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.