vih / vih_lectures_pdf

Drupal module to add pdf to lectures.
0 stars 0 forks source link

PDF link not shown anymore because $node->type changes #2

Open lsolesen opened 10 years ago

lsolesen commented 10 years ago

The type is expected to be 'vih_lecture' but it is 'vih_short_course_kajak' when debugging. I've debugged using Xdebug and PHPStorm.

It happens already in the second file where you can see that the 'bundle' starts out as 'vih_lecture' on page_callback_result under nodes, but when looking at #node it has been altered to 'vih_short_course_kajak'.

https://www.dropbox.com/s/ji7en4ptiziu1kw/Screenshot%202014-03-07%2021.12.32.png

dsnopek commented 10 years ago

What page are you viewing for this backtrace? Is the node/%/view for that node?

lsolesen commented 10 years ago

node/2435

dsnopek commented 10 years ago

I think I've found where the error is:

vih_short_course_commerce/vih_short_course_commerce.module line 150: https://github.com/vih/vih_short_course_commerce/blob/7.x-1.x/vih_short_course_commerce.module#L150

  if (!$course_is_expired AND $entity->type = 'vih_short_course_kajak') {

It's a type-o: = (setting the value) rather than == (testing the value)

Here is a pull request with the fix:

https://github.com/vih/vih_short_course_commerce/pull/24