Fix various critical errors

Created on 10 May 2016, over 8 years ago
Updated 19 September 2024, about 2 months ago

The 8.x-2.x branch of jQuery Social Stream has a number of bugs that render it unusable as it is which I have fixed for my current project:

  • CSS and JavaScript for the wall display and the light/dark displays don't get attached because CSS and JS can no longer be #attached directly in Drupal 8. I converted them to libraries.
  • jquery_social_stream_validate_container_id() calls form_error(), which no longer exists. I replaced it with $form_state->setError().
  • The RSS feed doesn't work. It converted it to a controller using the code from the library, modified as little as possible to make it work.
  • The controller uses drupal_json_encode(), which no longer exists. I replaced it with the new Json::encode().

I made a couple of other changes for my project needs which I'm including for consideration:

  • I renamed and categorized the block. On my project, non-technical content editors will be routinely placing the block, and "jQuery" means nothing to them. So I renamed the block to merely "Social stream" and put it in a "Social media" category.
  • My themer needed some additional classes in the HTML to distinguish between wall and non-wall displays and between light and dark styles, so I added those.

There are two remaining opportunities for improvement I would like to surface as well:

  • The RSS callback code, as taken directly from the library, (see jquery_social_stream_rss_callback()) takes URL arguments and uses them without sanitizing them. This of course represents a possible abuse vector. Since the code came directly from the third party library we alerted them, and hopefully they will fix it upstream. But either way, it needs to be addressed before making a full, stable release
  • Many of interface strings are not translated properly. Specifically, a lot of them include full links directly in the translateable text. See Dynamic or static links and HTML in translatable strings β†’ for an explanation of the correct way to do it.
πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States traviscarden

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024