Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2011 at 22:53 UTC
Updated:
3 Sep 2011 at 11:53 UTC
Jump to comment: Most recent file
Comments
Comment #1
slashrsm commentedWhere did you use this field? I used it on footer and found out, that it includes format to export if Full HTML or Plain text are used. If I use Filtered HTML it exports no info about text format.
I am not sure, but this could be "by desing" behaviour.
Can you try to change text format and export again to see if you have same behavour as I have?
Comment #2
merlinofchaos commentedYes, items that have default values are not exported.
Perhaps you should expand upon this: "which causes undesired behaviors for exported/code-based views." What are undesired behaviors?
Comment #3
duellj commentedSorry, I should have investigated this a bit more. The undesired behavior I was seeing is that if the format isn't set for the view, for anonymous users it would show the Textarea as plain text. This is because on my site anonymous users only have access to the plain text format. So when there isn't a format option, views_handler_area_text defaults to filter_default_format(), which only load the formats the current user (which is anonymous when viewing the view) has access to. So even though the default input format is Filtered HTML for admin users (who created, exported the view), the Textarea is being displayed as Plain Text (default input format for anonymous users).
So the solution is to:
It seems like 1 would be a lot easier.
Comment #4
merlinofchaos commented1) is, believe it or not, a lot harder.
It means that the default value for filters in Drupal 7 is too smart for its own good, and is therefore broken. Here's the thing: This should be true even if the view is not exported because the value used will be the same (which is the default filter format).
Oh Drupal.
Comment #5
dawehnerWhat about something like this?
Comment #6
duellj commenteddereine,
That works for newly created views, but for old views that were using the default input filter for textareas (and therefore don't have an input filter defined in the view) show nothing for the textarea. Looks like it's because of in views_handler_area_text::render_textarea():
and you can't go directly to check_markup, because it defaults to the Plain Text format. So in order to not break old views you still need to provide a default filter format when the textarea is rendered (unless you're not caring about backwards compatibility).
Indeed, merlinofchaos, this does seem a lot harder then it first seemed :).
Comment #7
dawehnerUpdated version based on last feedback.
Comment #8
dawehnerSee #1065344: No text area for header/footer/empty text when creating view for a patch with the same kind of problems.
Comment #9
muriqui commentedsubscribe
Comment #10
damien tournoud commentedFree reroll. This makes a lot of sense.
Any exported view containing a text area handler will currently trigger ugly notices.
Comment #11
damien tournoud commentedviews_plugin_exposed_form_input_required also had the same issue.
Also, I removed the unnecessary (and probably dangerous) fallback to the default. This is handled by core in a proper way in Drupal 7.
Comment #12
bojanz commentedThis completely makes sense.
Comment #13
dawehnerAfaik this was included because filter_format_load(d6, or equal named function) didn't had static caching.
Thanks for rerolling/improve the patch and review it. Commited to 7.x
Comment #15
BeaPower commentedWill this patch allow me to use text formats in views global area field?