Currently, I'm using the latest development versions of Views and FullCalendar. Inside a fullCalendar-styled view, I've added a global text field to render the edit url of the node (/node/[nid]/edit?destination=the/path/of/the/view), and I've set the FullCalendar's Custom URL option pointing to this field. The result is that the link doesn't work, because it's encoded this way:

/node/28/edit%3Fdestination%3Dthe/path/of/the/view

Then, the whole "edit%3F...view" is considered by Drupal as a wrong argument and the link always goes to the view page of the node.

Maybe I'm wrong and this is not a FullCalendar's bug, but Drupal core's, I'm not sure.
I've browsed through code (sorry, I'm new to Drupal module development), and I've found out that theme.inc stores the correct URL in $entity->url, I mean not url-encoded. But I cannot find when (and where) the encoding happens! Maybe inside drupal_render()?

Help!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
1.27 KB

The url there is passed through url(), which expects any query portion to be included separately.

This could be fixed if #939462-62: Specific preprocess functions for theme hook suggestions are not invoked is committed to D7.

tim.plunkett’s picture

Now with better comments and returning as early as possible if there is no query string.

itrivino’s picture

I'll try this. Thank you very much.

By the way... will this feature be included in fullcalendar's code?

itrivino’s picture

Sorry, Tim.

I don't know what's going on, but the new function seems to be never called. I've cleaned the views' cache, and all other caches as well (via Admin menu module), and I've entered a file_put_contents command to track the execution of the function, and nothing has happened. What can be wrong?

tim.plunkett’s picture

Status: Needs review » Postponed

@itrivino, I was not clear in my post. This will not work unless you apply the patch in the core issue I linked to above. That issue is exactly WHY the function will not run.

Once that is committed, I will add this into FullCalendar.

But for now, you could patch core for your own site and use this code.

itrivino’s picture

Status: Postponed » Closed (fixed)

Aaaaah, OK. :)

Thanks indeed.

tim.plunkett’s picture

Status: Closed (fixed) » Postponed
NWOM’s picture

Thanks so much for working on this. I applied the drupal core patch as well, and for some reason my theme had issues even loading afterwards. I'm guessing that the Adaptive Themes subtheme that I have is not yet compatible with the patch.

Does anyone know of a workaround that I could temporarily use until I figure out how to fix the subtheme compatibility problem?

Thanks in advanced.

Edit: Nevermind. I figured it out. The Drupal Core patch and the patch in this thread worked without problems. I must have patched it wrong and then afterwards I had to clear the cache manually by truncating all Cache tables.

NWOM’s picture

The above patch works along with the core patch, however I noticed an odd behavior.

After truncating all cache tables and watchdog it works without problems. As soon as I clear the cache via Drupal-> Performance, it however stops working and I have to truncate the tables in order to get it working again.

I can keep reproducing this behavior.

Would this be a problem with the fullcalendar patch, or the core patch?

tim.plunkett’s picture