Issue #1 resolved

Data truncated for column 'image' at row 1

Anonymous created an issue

The table cmsplugin_lightboxpicture describes image to be of a length of 100. This is definitely very optimistic, especially on Linux systems.

I advise to increase it to the max or even switch to a TextField type.

Cheers Fabian

mysql> describe cmsplugin_lightboxpicture;
+------------------+--------------+------+-----+---------+-------+
| Field            | Type         | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| cmsplugin_ptr_id | int(11)      | NO   | PRI | NULL    |       |
| image            | varchar(100) | NO   |     | NULL    |       |
| classes          | varchar(255) | YES  |     | NULL    |       |
| style            | varchar(255) | YES  |     | NULL    |       |
| thumbsize        | varchar(20)  | NO   |     | NULL    |       |
| alt              | varchar(255) | YES  |     | NULL    |       |
| rel              | varchar(60)  | YES  |     | NULL    |       |
| longdesc         | varchar(255) | YES  |     | NULL    |       |
+------------------+--------------+------+-----+---------+-------+
8 rows in set (0.00 sec)

mysql> select * from cmsplugin_lightboxpicture;
+------------------+------------------------------------------------------------------------------------------------------+---------+-------+-----------+------+------+----------+
| cmsplugin_ptr_id | image                                                                                                | classes | style | thumbsize | alt  | rel  | longdesc |
+------------------+------------------------------------------------------------------------------------------------------+---------+-------+-----------+------+------+----------+
|                1 | /Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/website/website/media/cms_page_media/1/ |         |       | 120x120   |      |      |          |
+------------------+------------------------------------------------------------------------------------------------------+---------+-------+-----------+------+------+----------+
1 row in set (0.01 sec)
Environment:


Request Method: POST
Request URL: http://localhost:8000/admin/cms/page/1/edit-plugin/1/

Django Version: 1.4.2
Python Version: 2.7.1
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'rosetta',
 'cms',
 'mptt',
 'menus',
 'south',
 'sekizai',
 'django.contrib.admin',
 'cms.plugins.text',
 'cms.plugins.file',
 'cms.plugins.googlemap',
 'cms.plugins.link',
 'cms.plugins.picture',
 'cms.plugins.twitter',
 'cms.plugins.video',
 'cms.plugins.link',
 'cms.plugins.snippet',
 'cms.plugins.teaser',
 'cms.plugins.inherit',
 'django_cms_urgaplugins.cmsplugin_lightbox',
 'website.apps.usermanager')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'cms.middleware.multilingual.MultilingualURLMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware')


Traceback:
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  89.         response = view_func(request, *args, **kwargs)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  196.             return view(request, *args, **kwargs)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/cms/admin/pageadmin.py" in edit_plugin
  1296.             response = plugin_admin.add_view(request)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  25.             return bound_func(*args, **kwargs)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  21.                 return func(self, *args2, **kwargs2)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/db/transaction.py" in inner
  209.                 return func(*args, **kwargs)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/contrib/admin/options.py" in add_view
  955.                 self.save_model(request, new_object, form, False)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/cms/plugin_base.py" in save_model
  160.         return super(CMSPluginBase, self).save_model(request, obj, form, change)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/contrib/admin/options.py" in save_model
  709.         obj.save()
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/cms/models/pluginmodel.py" in save
  223.             super(CMSPlugin, self).save()
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/mptt/models.py" in save
  696.         super(MPTTModel, self).save(*args, **kwargs)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/db/models/base.py" in save
  463.         self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/db/models/base.py" in save_base
  551.                 result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/db/models/manager.py" in _insert
  203.         return insert_query(self.model, objs, fields, **kwargs)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/db/models/query.py" in insert_query
  1593.     return query.get_compiler(using=using).execute_sql(return_id)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
  910.             cursor.execute(sql, params)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/db/backends/util.py" in execute
  40.             return self.cursor.execute(sql, params)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/django/db/backends/mysql/base.py" in execute
  114.             return self.cursor.execute(query, args)
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/MySQLdb/cursors.py" in execute
  203.         if not self._defer_warnings: self._warning_check()
File "/Users/rothfuchs/Documents/workspace/Atelier_Gebhard_Website/pyenv/lib/python2.7/site-packages/MySQLdb/cursors.py" in _warning_check
  117.                     warn(w[-1], self.Warning, 3)

Exception Type: Warning at /admin/cms/page/1/edit-plugin/1/
Exception Value: Data truncated for column 'image' at row 1

Comments (1)

  1. Log in to comment