JS Errors Within Console


This one appears globally throughout the site:
Code
TypeError: all_e[i].className.indexOf is not a function[Learn More] staff_ssl.js:14:66
script_load_stuff_staff <mybaseurl>/themes/intro/templates_cached/EN/staff_ssl.js:14:66
script_load_stuff <mybaseurl>/themes/intro/templates_cached/EN/global_ssl.js:35:340
<anonymous> <mybaseurl>/:1853:9
This error came from my console and shows in topicview of the forums:
Code
TypeError: $(...).sew is not a function[Learn More] script.php:46:34
set_up_comcode_autocomplete <mybaseurl>/data/script.php:46:34
<anonymous> <mybaseurl>/forum/index.php:2320:3
This one is the same as the previous one above, except this one is from Composr:
Code
46: TypeError: $(...).sew is not a function
<mybaseurl>/themes/island/templates_cached/EN/jquery_autocomplete_ssl.js?1535498189
Another one that shows in the console in topicview:
Code
Content Security Policy: The page’s settings observed the loading of a resource at self (“script-src”). A CSP report is being sent. Source: onclick attribute on A element. fastbutton
Any insights would be appreciated! Thanks!


https://github.com/ocproducts/composr/commit/a634e6c79a6fa1c1f8190ed94453b2327eb8faa0
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Edit2: I'm getting an additional error when making selections in the page rendering tool (i.e. 'templates'):
1: ReferenceError: staff_actions_change is not defined
Edit 3: I've noticed the above error regarding staff_actions_change only appears when viewing a missing resource.
According to GLOBAL_HTML_WRAP, the 'Staff Actions' feature only shows if these are all true:
- {$NOT,{$MOBILE}}
- IF_NON_EMPTY,{$STAFF_ACTIONS}
- {$CONFIG_OPTION,show_staff_page_actions}
If this feature shouldn't be available when viewing non-existent resources, maybe add another directive to GLOBAL_HTML_WRAP to hide visibility or make {$STAFF_ACTIONS} EMPTY?
Last edit: by Joe


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.




$(...).sew - fixed. 3 versions of jQuery were used on your site. I have commented out from HTML_HEAD.tpl and GLOBAL_HTML_WRAP.tpl in your theme, and I've forced Composr's bundled jQuery to always load instead.
I can't guarantee that whatever jQuery plugins you've used are compatible with ours (1.8.3), in which case you'd need to go much deeper somehow because I don't think the jQuery plugins we use out of the box will be compatible with a newer jQuery.
Content Security Policy - this will be coming from 3rd party servers, probably where you're loading JS files from.
ReferenceError: staff_actions_change is not defined - I think you just need to wait a while until all JS scripts are loaded and parsed. I could not reproduce, but I know the aforementioned situation would cause it. In v11 all our JS is going to be in .js files so this situation could not happen (instead JS interactions would not be available until the JS files load).
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.



I honestly had no idea I had 3 versions of jQuery running! My problem is, I'm always adding and removing stuff, and I don't always completely remove traces of things I don't keep. I'll just go through the HEAD section and remove some old scripts (I've noticed a few more that I don't even use).
I'll try out the bundled version of jQuery; hopefully I don't have issues. If I do, can you say for certain that Composr's plugins aren't compatible with newer versions of jQuery, or could I try swapping it out and see how things go?
If you're not certain:
- What is the location of Composr's bundled jQuery file?
- What Composr modules/addons/plugins utilize this? (so I can experiment)
Again, I'll only attempt that if you aren't certain about it and only if I have any problems running my plugins.
Thanks again Chris.


I'll try out the bundled version of jQuery; hopefully I don't have issues. If I do, can you say for certain that Composr's plugins aren't compatible with newer versions of jQuery, or could I try swapping it out and see how things go?
If you're not certain:
What is the location of Composr's bundled jQuery file?
What Composr modules/addons/plugins utilize this? (so I can experiment)
themes/javascript/
jquery.js
I'm 70% sure it'd be an issue.
jquery_ui.js - this is a heavyweight used in a few places
jquery_autocomplete.js - this is our code built around the jQuery 'sew' addon
select2.js - this is for fancy autocompletable lists
widget_date.js - fancy date picker for browsers without native HTML5 one
widget_color.js - fancy color picker for browsers without native HTML5 one
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.