Hi,

I'm making a website where I want to be able to sell a course (using commerce) in some weeks over the year.
I want to show a calendar on the products, using product displays and referencing to the product (where the date is, not in the product display).
When I see the calendar I get the title and the days of the course properly, but the link of them is referred to the administration of the product, and not to the product display,

hope somebody can help me!

greetings

cirk

CommentFileSizeAuthor
#4 scr.png41.88 KBjcir
#11 fullcalendar-1393274-11.patch521 bytestim.plunkett
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aspilicious’s picture

In the fullcalendar settings of a fullcalendar view is a fieldset named "customize fields".
In the list you can select "rewrite url".

You can use that to refer to a field that contains the link to the product display.

jcir’s picture

Hi,

Thank you for the answer.
I tried that, but it still refers to the product admin, and not to the product display.
I also tried to put another field than the date in first place of the fields (the title), but didnt change anything either.
I don't know if It is a bug or not, but it keeps just pointing at the product anyways

aspilicious’s picture

Can you provide some screenshots of the views settings and a link to the calendar? because It should work. I just retested everything.

jcir’s picture

Title: FullCalendar assumes that an entity has a URI » Use of fullcalendar with commerce
Category: bug » support
Status: Closed (fixed) » Active
FileSize
41.88 KB

- link not working -

aspilicious’s picture

Hmm I see some changes on your site :).

But the warning on top is something nasty...

Notice: Undefined index: path in fullcalendar_prepare_events() (line 228 of /var/www/cooking/sites/all/modules/fullcalendar/theme/theme.inc).

This is caused by

        $uri = entity_uri($entity->entity_type, $entity);
        $entity->url = $uri['path'];

This means the commerce entities are doing something "special" with $uri.
I'll have to install commerce to verify this.

aspilicious’s picture

Ok I installed the commerce kickstart module together with latest fullcalendar_dev and I get the correct results

1) Add Content: title, Content: path, and (Reference product) date as fields.
2) Go to settings, rewrite url and choose "content:path"

Thats it :)

ps: I don't get those red notices you have.

jcir’s picture

Wow,

thank you very much, or dank je well :)
I just get one more error but I should find out why this happens

The path that its taking is this one: cooking/%3Fq%3Ddisplays-all-courses
but I wanted only the second part: displays-all-courses

(I actually want more than one display so just puting the pat to displays-all-courses wouldnt be the solution)
(and thats why I think I still get those red errors...)
(Im also using the last dev version of fullcalendar)

thanks again!

aspilicious’s picture

Status: Active » Fixed

I think you should turn clean urls on. That should fix part maybe all your issues.
Anyway I mark this issue as fixed.

jcir’s picture

Status: Fixed » Active

Fixed the part of the link,

In the Views part.
FIELDS
Content: Path (Path)

I had to put in the Use absolute link (begins with "http://")
Enable this option to output an absolute link. Required if you want to use the path as a link destination (as in "output this field as a link" above).

But I couldnt fixed the red part.
Notice: Undefined index: path in fullcalendar_prepare_events() (line 228 of /var/www/cooking/sites/all/modules/fullcalendar/theme/theme.inc).

jcir’s picture

thanks for the help and the good work aspilicious
:)

tim.plunkett’s picture

Title: Use of fullcalendar with commerce » FullCalendar assumes that an entity has a URI
Category: support » bug
Status: Active » Needs review
FileSize
521 bytes

I read the docs on entity_uri() and noticed that it can return "NULL if the entity has no uri of its own".

So this is a bug, and this should fix it.

tim.plunkett’s picture

Status: Needs review » Fixed

Small mistake in the patch, I had = instead of :.
But I tested this, and it looked good.

http://drupalcode.org/project/fullcalendar.git/commit/ebf3579

jcir’s picture

Thanks!!

it's working perfect with the new version (I'm using by now the dev version 7.x-2.x-dev)
(with the 2.0-beta2 it gives warnings, so kepts with the dev one)

Status: Fixed » Closed (fixed)

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

Status: Active » Closed (fixed)