Project

General

Profile

Bug #7785

jQuery syntax error: unterminated regular expression literal

Added by Kill Bill over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Start date:
08/19/2017
Due date:
% Done:

0%

Estimated time:
Affected Version:
2.4
Affected Architecture:
All

Description

On dashboard, this keeps spamming the browser console over and over again.

Uncaught SyntaxError: Invalid regular expression: missing /
    at eval (<anonymous>)
    at jquery-1.12.0.min.js?v=1467049863:2
    at Function.globalEval (jquery-1.12.0.min.js?v=1467049863:2)
    at Ha (jquery-1.12.0.min.js?v=1467049863:3)
    at n.fn.init.append (jquery-1.12.0.min.js?v=1467049863:3)
    at n.fn.init.<anonymous> (jquery-1.12.0.min.js?v=1467049863:3)
    at Y (jquery-1.12.0.min.js?v=1467049863:3)
    at n.fn.init.html (jquery-1.12.0.min.js?v=1467049863:3)
    at Object.success ((index):1510)
    at i (jquery-1.12.0.min.js?v=1467049863:2)

History

#1 Updated by Jim Thompson over 2 years ago

  • Assignee set to Steve Beaver

#2 Updated by Steve Beaver over 2 years ago

  • Status changed from New to Feedback

Possibly resolved by #7784

#3 Updated by Kill Bill over 2 years ago

Steve Beaver wrote:

Possibly resolved by #7784

Still there with 2.4 RC. This seems like the Squid widget is causing this: https://github.com/pfsense/FreeBSD-ports/blob/devel/www/pfSense-pkg-squid/files/usr/local/www/widgets/widgets/squid_antivirus_status.widget.php#L174

@sbeaver: Not exactly sure what's the issue there, mind fixing that one? Thanks. (Looking at that widget, perhaps the centralized refresh magic as well... no idea how to do that.)

#4 Updated by Steve Beaver over 2 years ago

  • Status changed from Feedback to Assigned

Thanks for the update. That explains why I couldn't find it :) I will take care of it today.

#5 Updated by Steve Beaver over 2 years ago

  • Status changed from Assigned to Feedback

Widget has been updated to use the new refresh system, and the regex eliminated by exiting the script where required, rather than filtering out the javascript later

#6 Updated by Kill Bill over 2 years ago

That worked, thanks. ;)

#7 Updated by Steve Beaver over 2 years ago

  • Status changed from Feedback to Resolved

#8 Updated by Kill Bill over 2 years ago

@sbeaver: I don't think the Squid change was supposed to go to 2.3.4; it badly breaks the dashboard (cannot add/remove/move anything there).

Uncaught ReferenceError: register_ajax is not defined

#9 Updated by Steve Beaver over 2 years ago

You are right :( Re-written to accommodate old and new refresh systems based on whether register_ajax() function exists.

#10 Updated by Kill Bill over 2 years ago

Steve Beaver wrote:

Re-written to accommodate old and new refresh systems based on whether register_ajax() function exists.

I'm just totally confused now. This was only committed to RELENG_2_3_4? The idea is pretty good to avoid maintaining different code for different branches, but kinda pointless when it's not used for 2.4.

Also, there's https://github.com/pfsense/FreeBSD-ports/pull/402 so perhaps could handle this in a way that doesn't cause Squid to be bumped 4 times a day. :)

P.S. Tested 0.4.40 with 2.3.4-p1 and it indeed works properly without breaking the dashboard.

#11 Updated by Steve Beaver over 2 years ago

I made a mistake. It was fixed as fast as possible and then fixed more comprehensively. Stuff happens.

The codebase wherein each widget does its own thing, and where contention issues exist needs to be left behind. It no longer exists in the 2.4 branch so I don't feel that I should add complexity to the code in case it should magically reappear one day. - It won't.

It has gone from 2.3 as well, but we have the issue that people running an older version of code can update to a new version of the widget - hence my mistake. While there are obvious advantages to having all the active branches containing the same code, there are more advantages, IMO, to keeping the code that is going forward clean, neat and maintainable. - In my mind at least.

#12 Updated by Kill Bill over 2 years ago

Well that's not a problem. I thought the intent of your latest fix was to have the same code on 2.3 and 2.4; if that's not the case, well no biggie. I don't see anyone touching the widget code anytime soon again -- unless broken by future pfSense code changes.

Also available in: Atom PDF