$nav_title gets incorrectly themed

in date_views/theme/theme.inc on lines 168 & 169:

$format_with_year = variable_get('date_views_' . $granularity . 'format_with_year', 'l, F j, Y');
$format_without_year = variable_get('date_views_' . $granularity . 'format_without_year', 'l, F j');

should be:

$format_with_year = variable_get('date_views_' . $granularity . '_format_with_year', 'l, F j, Y');
$format_without_year = variable_get('date_views_' . $granularity . '_format_without_year', 'l, F j');

note the extra "_" prefer on format, this allows it to read the correct variable name instead of always falling back on the default

CommentFileSizeAuthor
#5 date_views-2333159-5.patch880 bytesrudiedirkx

Comments

nohup’s picture

Status: Active » Reviewed & tested by the community

This fixes it. Thanks.

fmb’s picture

peterx’s picture

We need the same fix to change the month heading from Monday, September 1 to September.

We also had to uninstall and install the date module to make it install the new date format settings in date_views_install();

rudiedirkx’s picture

Issue summary: View changes
rudiedirkx’s picture

StatusFileSize
new880 bytes

Patch attached for solution in OP.

.

Another part of the bug is that the actual default for all X_format_with_year is "l, F j, Y", while in the UI config form, EVERY variable has a different format.

My use case was with granularity "month". In the code (in theme_date_nav_title()) defaults "l, F j, Y" (with year) and "l, F j" (without year) are used. In the config form on admin/config/regional/date-time/date-views the defaults were "F Y" and "F" resp., which are indeed right. Submitting the form fixed everything, but it's a horrible practice in a bad update.

No patch for that. Not worth it for me.

podarok queued 5: date_views-2333159-5.patch for re-testing.

cafuego’s picture

Version: 7.x-2.8 » 7.x-2.x-dev
Status: Reviewed & tested by the community » Closed (duplicate)