Skip to:
Content

Opened 6 years ago

Closed 6 years ago

#5205 closed defect (bug) (fixed)

IE8 bug in global.js (String.prototype.trim is undefined)

Reported by: tomdxw Owned by: r-a-y
Milestone: 1.9 Priority: normal
Severity: normal Version: 1.8.1
Component: Core Keywords: has-patch
Cc:

Description

I couldn't find any information on what browsers BuddyPress supports, so I don't know if this is a valid bug or not, but I'll report it anyway.

  1. Use IE8, with BuddyPress and the bp-default theme activated
  2. Visit a group
  3. Type something into the "what's new" box
  4. Click "Post Update"
  5. IE8 reports an error on line 1502 of global.js and the post is not submitted

To fix I simply added this polyfill: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim#Compatibility

Change History (3)

#1 @boonebgorges
6 years ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to 1.9
  • Owner set to r-a-y
  • Status changed from new to assigned

Thanks for the report. Adding the polyfill seems reasonable if it fixes the issue.

r-a-y, as our resident IE8 expert, could you have a look?

#2 @r-a-y
6 years ago

  • Keywords needs-testing removed

Tested and bug confirmed. Thanks tomdxw for reporting.

Instead of using the polyfill, I'm going to use jQuery's trim() function instead since jQuery already has a trim function and we already have jQuery loaded.

#3 @r-a-y
6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 7443:

JS: Replace String.trim() method with jQuery's trim() function.

When using IE8 and when attempting to post an activity update, IE8
will throw an error and not post the update because of the usage of
String.trim(), which does not exist in IE8.

To fix this bug, we replace String.trim() with jQuery's version of
trim().

Props tomdxw for reporting the bug.

Fixes #5205.

Note: See TracTickets for help on using tickets.