Opened 7 years ago
Closed 7 years ago
#42802 closed defect (bug) (fixed)
Custom HTML widget validation error
Reported by: | markemark | Owned by: | westonruter |
---|---|---|---|
Milestone: | 4.9.3 | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | Widgets | Keywords: | has-patch fixed-major |
Focuses: | javascript, administration | Cc: |
Description
Hi there, recently updated to latest wordpress version 4.9.1
Now custom html widget, which works, now I cannot save, says there is a validation error, so I cannot edit and save.
Here is the html (with external javascript)
<div class="cta_addtocart"> <h3>Sober Intervention Training</h3> <p>(Course Delivered in English)</p> <p class="space">Just 20 places in total</p> <p class="days">3 DAYS - Friday 16th February 2018 - Sunday 18th February 2018</p> <p class="where">Tegnérgatan 24, 113 59 Stockholm, Sweden</p> <script type='text/javascript' src='https://www.universe.com/embed2.js'></script> [x_button type='flat' shape='rounded' size='large' href='https://www.universe.com/events/sober-academy-sober-intervention-training-tickets-9TFQX2' title='Sober Intervention Training - Stockholm']Get Tickets[/x_button] </div>
I have tried with and without "type='text/javascript'" - but still error, therefore I cannot edit?
Can you please fix ?
Attachments (3)
Change History (21)
#2
@
7 years ago
- Keywords dev-feedback added
@markemark You are getting error due to the quotation issue on type and src. You need to define the type and src attribute in double quotes instead of single quote.
So, Your code something looks like this:
<div class="cta_addtocart"> <h3>Sober Intervention Training</h3> <p>(Course Delivered in English)</p> <p class="space">Just 20 places in total</p> <p class="days">3 DAYS - Friday 16th February 2018 - Sunday 18th February 2018</p> <p class="where">Tegnérgatan 24, 113 59 Stockholm, Sweden</p> <script type="text/javascript" src="https://www.universe.com/embed2.js"></script> [x_button type='flat' shape='rounded' size='large' href='https://www.universe.com/events/sober-academy-sober-intervention-training-tickets-9TFQX2' title='Sober Intervention Training - Stockholm']Get Tickets[/x_button] </div>
Hope, it helps you :)
#3
@
7 years ago
It's either that or an issue with unfiltered_html
. Really the use of single quotes shouldn't be an error. It should be a warning at most.
#4
@
7 years ago
- Keywords has-patch needs-testing added
Patch has been added for changing the error to warning and the message as well. Please refer:
https://core.trac.wordpress.org/attachment/ticket/42802/42802.2.patch
Previous Message:
Attribute values must be in double quotes.
Updated Message:
Attribute values should be in double quotes.
#5
@
7 years ago
- Keywords dev-feedback removed
- Milestone changed from Awaiting Review to 4.9.2
@sasiddiqui Patching HTMLHint isn't going to be the right solution. Instead, the attr-value-double-quotes
rule should just be removed: https://github.com/WordPress/wordpress-develop/blob/1c2b0762c7f1a91394c633ae812505919bd297ed/src/wp-includes/general-template.php#L3253
@markemark Please confirm which validation error message you're setting.
#7
@
7 years ago
@westonruter I have patched HTMLHint to make doublw quotes error to warning as i thought it should be warned to user when single quote with attributes it doesn't need to be removed.
Anyways, if you just want to remove the rule so you just make it false for now.
#8
@
7 years ago
- Keywords has-patch added; needs-patch removed
Just waiting for @markemark to respond to confirm the issue.
#10
@
7 years ago
@markemark please confirm that the 42802-remove-rul.patch fixes the issue so we can merge into the next release.
This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.
7 years ago
#13
@
7 years ago
@markemark Kindly get sometime from your schedule and check 42802-remove-rul.patch either it fixes your defined issue or not.
Please provide your feedback after testing it.
Thanks
#15
@
7 years ago
- Owner set to westonruter
- Status changed from new to accepted
- Version changed from 4.9.1 to 4.9
@sasiddiqui I don't think there's anything else to do here to own. I just need to commit. I would have preferred to have @markemark test it first, however.
@markemark What is the validation error you are getting?