I'm using this module with nodeformpopup in conjunction with vote_storylink. When the selected text has an apostrophe or a quote, the form is populated only till the apostrophe or quote. It somehow acts as a terminator.

Comments

drupalzack’s picture

This doesn't happen on all sites, but on some

Egon Bianchet’s picture

Status: Active » Postponed (maintainer needs more info)

I am not able to reproduce this issue. Does this happen in the URL field? in the body?

Try to delete your nodeformpopup bookmarklet and add it again after updating the module to the latest 4.7 version. Make sure to have the latest nodeformtemplate too

drupalzack’s picture

Hi!
Sorry for the long delay. Here's how to reproduce this:

Download the latest nodeformpopup and nodeformtemplate (4.7-dev, not head) for drupal 4.7
Enable nodeformpopup for Blogs, set template for blogs as %title and %description (for selected text)

The idea is you should be able to go to any external webpage, select a text and submit it to a blog via nodeformpopup. (for purpose of illustrating this bug).

Goto http://www.dnaindia.com/report.asp?NewsID=1075610

Select the first paragraph.

With ‘Water’ continuing to make waves, John Abraham was hoping to carry his association with director Deepa Mehta and the West to a new level with their next project ‘Exclusion’.

This para has quotes in them which is where this module doesn't work as expected. Now, submit via nodeformpopup.

The title field is properly filled
The description field(selected text) only has the word 'With'. Barfs when it finds an apostrophe or quote.

Anonymous’s picture

I'm reporting this so that you know this problem doesn't just happen with nodeformtemplate. I created a simple module that creates nodes by importing the body of an html page. When it get's to an apostrophe, it stops importing.

Egon Bianchet’s picture

Title: When selected text has an apostrophe, form is populated only till that apostrophe » bookmarklets should encode the description
Project: nodeformtemplate » nodeformpopup
Version: 4.7.x-1.x-dev » master
Status: Postponed (maintainer needs more info) » Active

It's very likely that it's the bookmarklet fault, since it's not url-encoding the selected text ...

drupalzack’s picture

Anyone had any luck fixing this?

I was looking at the wordpress bookmarklet and it correctly handles quotes. Here's what it does:

javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='http://www.example.com/wp/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);

The only diff between this and our module is, wp doesn't open another window. For some reason a similar code isn't working. I'm not a js guy

drupalzack’s picture

Never mind fixed it. Takes a little while to get used to javascript. As suspected, encoding was the problem.