The Repeats tab shouldn't show on nodes without repeating dates. Patch up next.

Comments

hitfactory’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB
tim.plunkett’s picture

StatusFileSize
new1.24 KB

Thanks for the patch!

The above check will prevent it from showing the tab on nodes without repeating dates, but if a node has two date fields and only one of them is repeating, both still show.

This takes care of both parts.

karens’s picture

Status: Needs review » Fixed

Looks good, committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

willvincent’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new835 bytes
new791 bytes

It looks like there have been additional changes since the patch(es) above got comit that have caused this issue to appear again.

Specifically, in the date_repeat_field_show() function, the fields that are being looped through are obtained with field_info_fields(), which gathers information about all fields on the site, rather than as was previously done with field_info_instances, to only get fields for the current entity and bundle.

The change requires another check in the if statement to ensure that the field being evaluated actually appears in the current entity/bundle.

I have attached a patch for this in both the older p0 format as well as the newer git patch format.

arlinsandbulte’s picture

Status: Needs review » Fixed
jlea9378’s picture

Priority: Normal » Major
Status: Fixed » Needs work

I downloaded and installed the latest dev version today but am still experiencing this issue. When I attempt to browse to a Date page I see the Repeats tab even if it doesn't have repeating dates. If I click on the tab I get a fatal error:
"Fatal error: Cannot access empty property in /var/www/html/drupal_test/modules/field/field.attach.inc on line 325"

Using:
Calendar 7.x-3.0+5-dev (2012-Mar-13)
Content Construction Kit (CCK) 7.x-2.x-dev (2011-Aug-22)
Date 7.x-2.2+14-dev (2012-Mar-13)
Views 7.x-3.3+45-dev (2012-Mar-13)
Drupal 7.12

I tried to apply the patch in #5 but got an error saying it was already applied, so I aborted.

Gib...’s picture

I have the same problem in all content types of the site, even though they have no date field at all.
2 tabs show up : View and Repeats (in French)
I use date, calendar, views in block on the page but no date fields in the content nodes themselves.
Calendar 7.x-3.0
Date 7.x-2.2
Views 7.x-3.3
Content Construction Kit (CCK) 7.x-2.x-dev (2011-Aug-22)
Drupal 7.12

karens’s picture

Status: Needs work » Fixed

"7.x-2.2" is not the latest version. Bug fixes go into the dev version, where it has been fixed.

Gib...’s picture

Thanks. The "bug" is gone with the dev version of Date.

For some time after upgrading to Drupal 7.x, it was writtent to use the dev versions of Date, Calendar, Views, etc. That info was removed and I thought it was better to switch to the recommended versions.
I've been using Drupal since about Drupal 6.4 and I'm still unsure what to do in these situations. It seems riskiy to use the dev versions when recommended ones are offered. It was necessary for some time since I have a multilingual site and only the dev versions worked. Then recommended ones were ok for a while... Now, there is a problem.... What should one do ? Try the recommeded and switch to dev if there is a problem ?
Thanks for the advice and your patience for newsbies.

karens’s picture

Use the recommended versions. But if you're seeing a bug and you want to get it fixed before a new release is issued you can move to the dev version. If it is fixed in dev it is 'fixed', so we mark this issue as done.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.