I just updated to 2.8 and ran the update.php but return the following error.
Now I cannot change or add any new image styles.

The error indicate that I need to make the square_thumbnail but I am not able to to do this.

After the update.php was run I got this:
Update #7227
Failed: PDOException: SQLSTATE[HY000]: General error: 1364 Field 'isid' doesn't have a default value: INSERT INTO {image_styles} (name, label) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => square_thumbnail [:db_insert_placeholder_1] => square_thumbnail ) in drupal_write_record() (line 7383 of /var/www/xxxxxxx/includes/common.inc).

If I try to make the square_thumbnail now it get the following:
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'isid' doesn't have a default value: INSERT INTO {image_styles} (name, label) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => square_thumbnail [:db_insert_placeholder_1] => square_thumbnail ) in drupal_write_record() (line 7383 of /var/www/xxxxxx/includes/common.inc).

The site is using a MySQL database.

The last update of the module is done on June 16, so I assume the patches above is done?
Hope someone is able to help on this one.

Comments

Jens Peter created an issue. See original summary.

joseph.olstad’s picture

Updated from which previous release?

Try manually deleting square_thumbnail image style found in admin/config/media/image-styles
Click on square_thumbnail and delete it. Then retry upgrade

You may need to also then recreate square_thumbnail image style , suggest 180px by 180px. Unless already correct after upgrade

jens peter’s picture

I cannot delete square_thumbnail as this type do not exists and I cannot make it.
I cannot correct, change or make any styles - all attempts give me the second error.

I am not sure what version I updated from but I think I ran the last update in the start of 2017.
I could try and upgrade to a version before 2.3 but there are so many to choose from.

joseph.olstad’s picture

Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)

This error says that there is no default value for isid on the image_styles table, meaning your schema (image_styles) table lacks a default or more likely, there should not be a default for an ID column such as isid. isid is a unique id or should be. More info: the image module is a core module, for a similar workaround/fix see https://drupal.org/node/1428176

joseph.olstad’s picture

Status: Postponed (maintainer needs more info) » Needs review
joseph.olstad’s picture

We haven't seen other reports of this issue. Hard to say if this is a bug yet. Wait and see if others upgrading from 1.x report this; between 10000 and 20000 media 1.x to 2.x upgrades have been performed since 7.x-2.0 was released. Very few reported issues. None like this. This is why I say, wait and see. I could try myself doing a 7.x-1.6 to 7.x-2.8 upgrade, last time I tested that upgrade was I think 7.x-1.6 to 7.x-2.3 and it went fine easy as pie.

joseph.olstad’s picture

Status: Needs review » Postponed (maintainer needs more info)

Qu'est ce qu'un default fait sur un champ unique ***EDIT*** frustration

jens peter’s picture

I didn't update from version 1. That I know for sure.

I do not understand the last question. I made an update that didn't work.
Now images styles are locked.
I have not done anything with fields.

joseph.olstad’s picture

can you log into mysql and type this:
describe image_styles;

mysql> describe image_styles;

+-------+--------------+------+-----+---------+----------------+
| Field | Type         | Null | Key | Default | Extra          |
+-------+--------------+------+-----+---------+----------------+
| isid  | int(11)      | NO   | PRI | NULL    | auto_increment |
| name  | varchar(255) | NO   |     | NULL    |                |
| label | varchar(255) | NO   |     |         |                |
+-------+--------------+------+-----+---------+----------------+

Does your image_styles table look similar to this?

mysql> select * from image_styles;
+------+------------------------+------------------------+
| isid | name                   | label                  |
+------+------------------------+------------------------+
|    1 | original_image         | original_image         |
|    2 | media_item_thumbnail   | Media Item Thumbnail   |
|    3 | square_thumbnail       | square_thumbnail       |
+------+------------------------+------------------------+
joseph.olstad’s picture

I suspect that you've got multiple copies of the media module on your filesystem.

To diagnose your system, it would be recommended to run the duplicate module finder module to find the duplicate copies. You should then remove the 'extra' copies of the modules.
https://www.drupal.org/project/dmf

joseph.olstad’s picture

Status: Postponed (maintainer needs more info) » Needs review
joseph.olstad’s picture

Status: Needs review » Postponed (maintainer needs more info)

without feedback there's not much we can do here.

jens peter’s picture

I do have other projects going so was not able to reply before today :-) No other modules support reply this fast, so I was not perperred for it.
Tomorrow I am leaving for a 2 week holiday so will not be able to follow up towards you on this before on my return.

I have looked in my database.

I has a different layout (phpMyAdmin) but there are 4 image styles.
Each has a number (isid) going from 1 to 4.
I cannot see any of them being primary.

There is no square_thumbnail - as that is not being created and when I try to do it manually it do not allow me.

I have tested for having the module two times but it is of cause not there anymore than one time.

I will test some more as this site was a copy that was moved from one domain to another - I wounder if there can be some parts pointing to the old location and this might be the problem.
I don't think so as I have moved sites many times before, but it is an idea I can look into.
Any other ideas would be very welcome.

jens peter’s picture

Status: Postponed (maintainer needs more info) » Active
joseph.olstad’s picture

please run the command in phpMyAdmin
use drupalDatabaseNameForJensPeterSystems;
describe image_styles;
compare it with the table describe that I did.

if you are using a prefix in your settings php the image_styles table might be called prefix_image_styles

joseph.olstad’s picture

otherwise try this; install registry_rebuild for drush
and then run
drush rr --fire-bazooka

joseph.olstad’s picture

Status: Active » Closed (cannot reproduce)
joseph.olstad’s picture

wrong issue

joseph.olstad’s picture

edit