First Off, thanks for the great module, I needed something like this for a project, and this saved me a bunch of time writing one myself.
I am using this module mostly for the embed feature, I do not require the share link, as I don't want visitors to actually share my view, I just need to embed the view on another website.
This plugin requires you to add a header to your view, which is obviously visible to visitors when the view is displayed. I can hide the header using CSS (which I did in some cases), but I would love to be able to remove the header from the view at the code level, so there is no output.
I went ahead and tried this, removing the header from my view, and constructing my own URL to the view embed. This worked very well, with one minor notice appearing:
Notice: Trying to get property of non-object in views_share_embed() (line 347 of /var/www/xxx/xxx/xx/sites/all/modules/views_share/views_share.module).
The notice is caused by:
$plugin = _views_share_find_plugin($view);
This function attempts to find the views_share_handler_area_share
plugin and returns NULL if it does not find it.
The notice arises, because the following lines assume the function above always returns a plugin:
$plugin = _views_share_find_plugin($view);
drupal_add_js(array('viewsShareEmbed' => array(
'rewriteLinks' => $plugin->options['rewrite_links'],
)), 'setting');
However, as noted above, _views_share_find_plugin
can return NULL.
Short of reworking the entire module to allow for embeds without the header being generated at all, I'll provide a patch that checks the value of $plugin in the above lines, and defaults to NOT re-writing the links, as we can't assume one way or the other.
I also suggest we log a message to watchdog indicating the issue, so site builders have a clue something that is going on.
Closed: outdated
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.