1) Tabs Availability and Prices are clearly visible on each node type, regardless of setting:1 from the variable table. I checked the variable table and I can see my node type stored there as rooms_node_mynodetype with a value 1.

2) Also, from an appropriate /node/X/edit page, you can see Availability (/node/X/availability) and the link works fine - it takes you to an appropriate /admin/rooms/units/unit/X/availability page. But when you go back and click on Prices (/node/X/prices), it give you a WSOD!

Reg. issue #2, I found the following errors in the logs:

Notice: Trying to get property 'title' of non-object in node_page_view() (line 2755 of /srv/http/mysite/modules/node/node.module).

EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7947 of /srv/http/mysite/includes/common.inc).

Comments

jazzitup created an issue. See original summary.

jazzitup’s picture

It turned out it was easy to spot, check rooms_node.module, line 41:

  $items['node/%/availability'] = array(
    'title' => 'Availability',
    'page callback' => 'rooms_node_availability',
    'page arguments' => array(1),
    'access callback' => 'rooms_node_check_node_type', // no underscore!
    'access arguments' => array(1),
    'weight' => '60',
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%/prices'] = array(
    'title' => 'Prices',
    'page callback' => 'rooms_node_prices',  // insert this line of code
    'page arguments' => array(1),
    'access callback' => 'rooms_node_check_node_type', // no underscore!
    'access arguments' => array(1),
    'weight' => '70',
    'type' => MENU_LOCAL_TASK,
  );

Line 257:

function rooms_node_prices($nid) {
  if (rooms_node_is_enabled($nid)) {
    $node = node_load($nid);
    $room_id = rooms_node_get_unit_id_by_nid($nid);

    if ($node && !$room_id) {
      rooms_node_insert($node);
      $room_id = rooms_node_get_unit_id_by_nid($nid);
    }
    if ($room_id) {
//      drupal_goto('admin/rooms/units/unit/' . $room_id . '/availability');
      drupal_goto('admin/rooms/units/unit/' . $room_id . '/pricing');
    }
  }
}
jazzitup’s picture

Priority: Major » Normal
Status: Active » Needs review
StatusFileSize
new2.13 KB

  • ziomizar committed 5d153d6 on 7.x-1.x authored by jazzitup
    Issue #3073394 by jazzitup: Availability and Prices tabs shown on all...
ziomizar’s picture

Status: Needs review » Fixed

Hi jazzitup,

Wow, i thought nobody was using rooms_node anymore!
Consider if you are using it in production, that this module has been marked obsolete and unsupported.

I don't have a quick way to test your patch. I can just trust your work, looking at the patch it make sense.

Thank you for working on this.

Status: Fixed » Closed (fixed)

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