Url field is too small

Permalink Browser Info Environment
The "Url" type generated a db.xml entry with ['type' => 'C', 'size' => 255]. But Url are supported in all browsers up to 2000 characters and the norm allows for 8kb URL. So there is an error message when the editors attempt to add a long Url :
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'link_url' at row 1

Type: Ticket
Status: Resolved
dangrth
View Replies:
ramonleenders replied on at Permalink Reply
ramonleenders
Hi there,

I've just updated the Add-On. The new version 1.2.2 should give you the 2000 maximum characters now. Can you confirm after updating your Add-On and Block Type?

Kind regards,
Ramon
concrete5cojp replied on at Permalink Reply
concrete5cojp
Hi, I tried to add a Url field, but it causes SQL error.
The type C doesn't allow more than 255 characters.
Please change it to type X.

$fields = [
            [
                'name' => $field->getSlug(),
-                'type' => 'C',
+                'type' => 'X',
                'size' => 2000,
            ],
        ];
ramonleenders replied on at Permalink Reply
ramonleenders
Hi there,

Thanks for pointing this out. I changed the type to the aforementioned type and it should be good to go now. The new version is ready for download.

Let me know if this fixed it for you!

Kind regards
Ramon

concrete5 Environment Information

# concrete5 Version
Core Version - 8.5.4
Version Installed - 8.5.4
Database Version - 20200609145307

# Database Information
Version: 5.7.33
SQL Mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

# concrete5 Packages
Block Developer (1.2.1), Colorpicker Attribute (0.4), Debug Kit (0.9.5), ExchangeCore Dev Tools (1.0.2), Migration Tool (0.9.1), Natixis Teora 2021 (1.0.1), Page Activity (0.9.3), Rescan All Files (0.1.5)

# concrete5 Overrides
None

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off
Full Page Cache Lifetime - Every 0 minutes.

# Server Software
Apache/2.4.38 (Debian)

# Server API
apache2handler

# PHP Version
7.3.27

# PHP Extensions
apache2handler, Core, ctype, curl, date, dom, fileinfo, filter, ftp, gd, hash, iconv, imagick, json, libxml, mbstring, mcrypt, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 120
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 120
max_input_vars - 1000
memory_limit - 256M
post_max_size - 8M
upload_max_filesize - 64M
mbstring.regex_stack_limit - 100000
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
opcache.max_accelerated_files - 5000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.