Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: JavaScript Errors When Apostrophe (or other non-alpha characters) are used in a textarea

Status Resolved
Add-on / Version Bloqs 4.0.3
Severity
EE Version 3.5.16

TJ Draper

Jun 20, 2018

Description: When saving text to a textarea in a block, if the text has an apostrophe or any non-alpha character as far as I can tell (for instance, a period will also cause the issue), upon loading of the edit entry page, a JS error will be encountered, which affects any further bloqs field by preventing it from functioning at all.


Detailed steps to reproduce the issue:
1. Create a block with a textarea and add it to a field/channel.
2. Add another block field type with some block type in it
3. Enter text in the textarea with an apostrophe somewhere in it.
4. Save the entry and note the JS error on the console. Also note that block fields on the page after the one with the textarea and non-alpha characters cannot expand the blocks (including new blocks added to that field)

 

 

#1

BoldMinded (Brian)

You’re using Chrome on a PC it looks like? I tested Chrome and Firefox on Mac and I can’t replicate.

https://screenshots.firefox.com/86xcSMrtjvCLsCUm/ee400.vm

TBH I don’t have a Windows test environment setup, and it will take some time (symlink/hosts config for Mac to VirtualBox communication etc). Do you have access to a Mac to see if this is Mac/PC related? You may not like the sound of this but if you can provide CP/FTP access to the environment it may be quicker for me to debug. Last time I tried to get a Windows environment working locally it took me hours to get the Mac/Windows/VirtualBox communication to work correctly.

#2

TJ Draper

Tested on Mac/Chrome, issue still present so it does not appear to be a Windows/Mac thing.

I can get you access to our dev environment where I’ve confirmed it’s still happening. I pushed out the lastest version of Bloqs and latest EE 3 to the dev environment. It’s set up with Cloud 9 Access so you can edit files, open a terminal to the file system, browse the file tree, etc. I’ll edit the ticket and provide credentials in the private fields and stuff.

#3

TJ Draper

I added credentials to the ticket. To see the issue in action, log into the CP and go to Edit > Portfolio. You’ll see my test entry there.

I put the Cloud 9 credentials in the FTP fields. When you log in to Cloud 9 you should see a directory tree. The project is in the directory dwgweb. Let me know if you have any questions, and feel free to ping me on slack if you need any real-time follow up.

#4

BoldMinded (Brian)

Comment has been marked private.

#5

BoldMinded (Brian)

Now the cp.js file on cloud9 is empty and I can’t replace it’s contents.

I’ve tried to replicate this locally in EE4 and EE3 and can’t do so. I’m using the same text in your screenshot that throws the error, and I could see it happening when logged into your dev environment (before cp.js got borked), and putting the same text into textarea fields locally didn’t throw the error.

#6

TJ Draper

Sorry about that. We had a disk space issue. I’ve increased the volume size so we should have plenty of space now if you want to try again.

#7

BoldMinded (Brian)

Might be fixed now. I was looking in the wrong place. Apparently this isn’t valid anymore:

'rte': function ($atomContainer) {
            return $($atomContainer.find('textarea').val()).text();
        }

Changing to this fixes it… basically RTE and textarea’s are treated the same.

'rte': function ($atomContainer) {
            return $atomContainer.find('textarea').val();
        }
#8

BoldMinded (Brian)

Actually looking at this again I don’t know how the first ever worked. It’s trying to use the value of the text field as the selector, which explains the error. Same thing is happening with Wygwam.

#9

TJ Draper

Committed and deployed the code you changed. Seems to be fixed.

Login to reply