Skip to content

Update admin.js for fix hashtag control issue#6902

Closed
CodeExplore wants to merge 1 commit intoelementor:masterfrom
CodeExplore:master
Closed

Update admin.js for fix hashtag control issue#6902
CodeExplore wants to merge 1 commit intoelementor:masterfrom
CodeExplore:master

Conversation

@CodeExplore
Copy link
Copy Markdown
Contributor

PR Checklist

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Summary

There is an issue for hash ( # ) tag issue in admin area.

Description

Let me explain it more. For eg. Go to Settings -> General and write a random hastag on the url addres. for eg:

http://localhost/wp/wp-admin/options-general.php#something=hello

refresh the page and take a look console. you will see

Uncaught Error: Syntax error, unrecognized expression: #something=hello
    at Function.fa.error (jquery.js?ver=1.12.4:2)
    at fa.tokenize (jquery.js?ver=1.12.4:2)
    at fa.compile (jquery.js?ver=1.12.4:2)
    at fa.select (jquery.js?ver=1.12.4:2)
    at fa (jquery.js?ver=1.12.4:2)
    at Function.fa.matches (jquery.js?ver=1.12.4:2)
    at Function.n.filter (jquery.js?ver=1.12.4:2)
    at z (jquery.js?ver=1.12.4:2)
    at jQuery.fn.init.filter (jquery.js?ver=1.12.4:2)
    at child.goToSettingsTab (admin.js?ver=2.4.4:353) <--- Problem here

https://github.com/pojome/elementor/blob/b7be36ae5b6fb9c90e3baa65c7adbe714c5733f0/assets/dev/js/admin/admin.js#L261

this.elements.$settingsFormPage missing and getting error. this error making conflict with another plugin hash tags. We need a IF control like this.

var $activePages = this.elements.$settingsFormPages;

if ( ! $activePages.length ) {
  return;
}

var $activePage = $activePages.filter( '#' + tabName );

Test instructions

I Tested the code, it works

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended
  • Docs have been added / updated (for bug fixes / features)

Fixes #

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 28, 2019

CLA assistant check
All committers have signed the CLA.

@bainternet
Copy link
Copy Markdown
Contributor

@CodeExplore

thanks, its merged into #6903

@bainternet bainternet closed this Jan 28, 2019
@CodeExplore
Copy link
Copy Markdown
Contributor Author

@bainternet you're welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants