For at least one month, the booking formlet no longer appears on panel page. It's OK on the standard node page. A problem of compatibility with the Panels module?

Comments

fietserwin’s picture

I've never used panels, so I can't help you by diving into the problem. It is a field, so I would not expect any problems.

Can you debug functions availability_calendar_booking_formlet_field_formatter_view_inc() and availability_calendar_booking_formlet_form_inc() (in file availability_calendar_booking_formlet.inc) to see if they are executed and do return some output?

Pycouz’s picture

Thanks for your answer. I don't know what do you expect, I have never debugged a Drupal module. How can I do that?

I can reproduce the bug on a fresh standard Drupal install with ctools, panels and availability_calendars modules installed. I create a new type of content with calendar and formlet fields inside. I create a node and all is OK. Body, calendar and formlet appear. If I overridden the default node system page with page_manager (admin/structure/pages) and body, calendar and formlet fields added, the bug appears. Body and calendar are displayed, not the formlet.

Pycouz’s picture

It seems to be related with CTools. I have created a bug report: https://www.drupal.org/node/2460113

Any help?

astringer’s picture

I ran into this issue when I was checking out the module. I'm planning on implementing as a entity, so it doesn't have implications for my current project. But to help improve the module and for anyone who runs into this issue and wants a way around it.

(Dev notes below the work around)

WORK AROUND (assuming you set up the calendar/booking formlet as fields on a node):

  • Create a view: of the content type that contains the calendar.
  • Add fields: add the Calendar and the Booking Formlet fields. (Delete title if you don't want it.)
  • Format/Show as: Display as panel fields (or you can create a view mode of just the calendar and booking formlet fields and "Display as content" using that view mode.
  • Contextual filter: Content: NID (assuming you are displaying this on a panelized node page).
  • Place the view pane in your panel.

DEV NOTES

On a panelized node/full page override: (So essentially on the node page -- but a panelized version of it).

The calendar displayed, but no formlet (and the option color wasn't marked on the calendar when clicked).

The warning: ctools_entity_field_content_type_admin_title: Context is missing for field: node:field_availability_calendar

So for the heck of it I add a relationship on the node to the calendar (that is a field on the node). I also tried to add a context for the calendar, but wasn't able to (which makes sense).

But after adding the relationship I got this message: Notice: Undefined index: access callback in ctools_entity_from_field_context() (line 188 of *** ctools/plugins/relationships/entity_from_field.inc).

Fixing this is not in my skill set but I am happy to provide any additional information or testing that would be helpful.

Pycouz’s picture

Thank you astringer for your help! I'm not alone on Earth :)

Your workaround works well. I hope that module's developers will take your investigation into account.

fietserwin’s picture

Provide a patch and I am all yours.

astringer’s picture

I will try to provide a patch, it will probably take me some time -- but I'm trying to expand my skill set in that area. I'm not so familiar with the under pinnings of panels to understand, without some research, why it doesn't work when placed as fields. But I've run into this issue before with another contrib module (which is why I knew the view would work). I suspect this isn't an uncommon problem integrating with panels and panelizer.

fietserwin’s picture

Status: Active » Closed (won't fix)

I am currently going through the issue queue and am closing old issues that have not had any response since long. Please feel free to reopen if you are still experiencing the problems, providing as much of the requested details as possible.

Note: Looking at the "Notice: Undefined index: access callback in ctools_entity_from_field_context()" I see it is now (ctools version 7.x-1.15) protected by a check if that entry is there at all in the array, so that should be gone now.

Note2: I do not have the time to dive into panels, so I am not going to solve this, even if it can be confirmed to be still there. I need a patch or clear instructions on what to change.