Closed (fixed)
Project:
Picture
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2014 at 01:32 UTC
Updated:
18 Jul 2014 at 14:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
attiks commentedShould be fixed by #2273249: Upgrade issue 1.3 to 2.0, a new verson will be released today.
Comment #2
timlie commentedI installed version 2.1 and still have the same issue as reported here:
Argument 1 passed to picture_get_mapping_breakpoints() must be an instance of PictureMapping
Comment #3
attiks commentedDid you specify a picture mapping on the field settings?
Did you ran update.php?
Comment #4
attiks commentedComment #5
ag_design commentedsame error..
Error message
Recoverable fatal error: Argument 1 passed to picture_get_mapping_breakpoints() must be an instance of PictureMapping, boolean given, called picture.module on line 367 and defined in picture_get_mapping_breakpoints() (line 1059 of picture.module).
The website encountered an unexpected error. Please try again later.
it is new install and not upgrading from previous version.
uninstall and enable again module , same error .
Comment #6
jstollerI concur. The line numbers have changed, but I've tried the new update on two different sites and both fail with this error on every page that uses a picture formatter.
In at least one instance I'm also getting the error:
Given that this renders the entire system unusable and has no known workaround, I think it meets the requirements for a critical bug, but feel free to change it back again if you really disagree.
I've been trying to figure out if there's some other module that might be triggering this error. One of my sites uses image fields and the other uses the Media and File Entity modules, so I suppose that doesn't matter. Both of the sites use Display Suite. In both sites, the images are generally not directly in the node entity, but rather in some other linked entity. On one site, I have a Bean entity loaded as a block in the footer on every page, which contains some image fields rendered as picture elements. That seems to be causing the entire site to bomb, so I can't even log in. That same site also loads images in page content that's stored in field collections on the node, rather than directly on the node. My second site loads most of its images from Paragraphs bundles that make up the page content. Paragraphs is very similar to field collections. Could it be that Picture is expecting its images to always be on a node?
Comment #7
attiks commentedCan you check the field settings and if necessary save them again, if that does not help, read on
Line 366 (
$picture_mapping = picture_mapping_load($display['settings']['picture_mapping']);) is getting the field settings, if this fails it returns false, hence the error on line 367.To debug you could add
dpm($display);as the first line in that function, if you get a white screen, addreturn;on the next line (part of the devel module). The dpm should show an array with an elementsettings, and inside an elementpicture_mappingComment #8
attiks commentedOutput of dpm should look similar to
Comment #9
ag_design commentedI must mention, that my error appeared when using within Views as a field "Picture"
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /admin/structure/views/view/slideshow_for_featured/preview/block/ajax
StatusText: Service unavailable (with message)
ResponseText: Recoverable fatal error: Argument 1 passed to picture_get_mapping_breakpoints() must be an instance of PictureMapping, boolean given, called in picture.module on line 369 and defined in picture_get_mapping_breakpoints() (line 1066 of picture.module).
Debug:
picture_mapping (String, 20 characters ) responsive_map
$...['settings']['picture_mapping']
fallback_image_style (String, 0 characters )
$...['settings']['fallback_image_style']
image_link (String, 7 characters ) content
$...['settings']['image_link']
colorbox (String, 20 characters ) responsive_map
$...['settings']['colorbox']
Comment #10
jstoller@attiks, are you perchance at DrupalCon? if so, I'm in the Coder Lounge at the Austin Convention Center right now and I'd be happy to work with you on this.
The array I get is:
When I go to the file display settings for my hero image, I get this error:
If I try to change the picture mapping setting, I get the error:
Then I noticed that the picture mappings on all of my file view modes are just defaulting to the first item in the list, so none of them are actually set. I thought this might be a Features problem, since all my configuration is stored in feature modules, so I created a new breakpoint group and configured its picture mappings, to try and get Features out of the picture, but that doesn't seem to have made any difference.
Comment #11
attiks commented#9: your settings do look correct, views is given a problem with me as well (Fatal error: Nesting level too deep - recursive dependency? in /data/disk/o1/static/sas/includes/common.inc on line 7530), I'll check later today
#10: picture_group is old and should disappear after saving the settings, can you test a plain node view to see it works?
PS: I wish I was at DrupalCon but alas
Comment #12
attiks commented"Notice: Undefined index: picture_mapping in picture_field_formatter_settings_form() (line 245 of /Users/jstoller/Sites/californiasciencecenter.org/www/sites/all/modules/contrib/picture/picture.module)" should be fixed
Comment #13
attiks commentedI tested the following, so far so good:
Comment #15
attiks commentedJust to be sure, you did clear all caches, and you could try drush cc views as well, or even drush rr
Comment #16
attiks commentedAnother possible solutions, edit and save all your picture mappings
Comment #17
timlie commentedI did use update.php and cleared the caches but still the same error.
Tried new dev version as well.
Comment #18
attiks commentedtimlie: you have it while displaying a node? Did you re-save the picture mappings?
Comment #19
timlie commentedI disabled the module and even uninstalled it so I don't have any picture mappings anymore.
Still I get the error.
Thanks!
Comment #20
attiks commentedTimlie i assume you created a new one and assigned on the display formatter?
Comment #21
timlie commentedAt first I just did an upgrade to version 2 of the module (I had picture mappings).
The error appeared.
I disabled the module now and uninstalled it as well. Now I have no picture mappings anymore but the error is still there.
Comment #22
attiks commentedtimlie: can you create a new mapping and try it using an image field on a node? Make sure the select the mapping after setting the output formatter to picture
Comment #23
timlie commentedI created a mapping but still when I visit a non admin page I get on every page the error. The rest of the page doesn't load.
Comment #24
robcarrI've re-saved all my breakpoints and it got rid of all but one of the Fatal errors.
The remaining error is associated with one View where Flexslider is used, which I currently cannot configure, as I get the following error when I click on 'Settings'
The table flexslider_picture_optionset doesn't exist (although table flexslider_optionsetis there). So with this problem, I'm still having WSOD on non-admin pages.
* EDIT *
My missing table is due to previous patches applied addressing #2084979: flexslider_picture broken on/after flexslider -alpha3.
brb
Comment #25
attiks commentedComment #26
jstollerAfter much exploration, I've managed to sort of work around this on one of my sites. It seems to more a problem with the picture formatter settings than with the picture mapping configurations. Features also seems to be complicating things. Here's what I did:
drush fuato update all features. This fixes the picture mappings in the features that have them.drush fuaagain. This changes the file display settings to use picture_mapping instead of the old picture_group.So, is it possible to update the picture display configuration for displays who's configuration is stored in a feature?
After all this I'm still getting one error, but I'm not sure if its related to the issue at hand:
Comment #27
jelle_sFile displays and field formatters are fixed in the latest dev version. The flexslider issues will be addressed in #2084979: flexslider_picture broken on/after flexslider -alpha3
Comment #28
jstollerI'm trying to test this, but there seems to be a problem with the download. When I update through drush it reports "File picture-7.x-2.x-dev.tar.gz_date=1401889727 is corrupt (wrong md5 checksum)." I also tried manually downloading from the project page, but what I get looks like the version from June 2.
Comment #29
sutharsan commentedRe-opening the issue.
The upgrade path is still broken. I have the same error message as reported by jstoller, using the latest dev, the error still remains. I first upgrade from 7.x-1.3 to 7.x-2.1, and now to 7.x-2.x-dev. For the sort term, please describe on how to get out of this situation. But we need a solid upgrade path because currently it is badly broken.
@jstoller, this is not related to the module, but to drupal.org's packaging script. I downloaded and unpacked the dev-release the 'old-fashioned' way.
Comment #30
attiks commentedErik did you use the git version or the dev version?
Comment #31
jstoller@Sutharsan, that's what I did in my second attempt, but the downloaded module was the wrong version. I'll try pulling from the GIT repo later.
Comment #32
attiks commentedThe dev version contains the latest changes now.
Comment #33
sutharsan commented@attiks, I used the dev release (sometimes I'm only human ;) ). The current dev release fixes the problem. Thanks so much!
Comment #34
jelle_sComment #35
jstollerI'm still getting the fatal error. The source seems to be that picture_update_7201() is using "picture_mappings" instead of "picture_mapping." The attached patch should fix this.
Comment #36
attiks commentedThanks, I'll create a new release in a sec
Comment #37
tgshannon commentedI'm still seeing this issue with the 2.3 release. I just started to use the picture and breakpoints module yesterday on a new installation local site. I started with the Bootstrap 3 theme, and did not see it work. So, today I started to use an Omega sub-theme. The error only shows on the home page, but the node pages are not being responsive. I started out with 2.0, updated to 2.2 today, and noticed you just released 2.3. I disabled the picture and breakpoint modules and uninstalled. Removed my test image styles, and then reenabled the picture and breakpoint theme. Created the breakpoints, generated the image styles using the large (480) image styles. Edit the new image styles to various settings, mapped the picture settings for the breakpoints to the appropriate image styles. Assigned the Article image field to picture using my new picture mappings group. Still seeing the error on the home page.
If you need I can start with a fresh install and database to help?
Which is correct? From picture module project page:
You have to order your breakpoints from the "largest" to the "smallest", but keep in mind that it depends if you use min or max queries, the picture element (and the polyfill) will use the first matching source tag.
From breakpoint module project page:
It is incredibly important to order the Breakpoints correctly before creating any Breakpoint groups.
Breakpoints need to be arranged from smallest to largest (from top to bottom). E.g. "mobile" at the top and "wide" below it.
If you create a Breakpoint group with the Breakpoints in the wrong order, the group becomes "locked" to the order that the Breakpoints were set in at its creation and your responsive images will not render properly.
If you find yourself in this situation, you should delete the broken Breakpoint group and re-create it after you've set your Breakpoints to the proper weighted order.
Comment #38
attiks commentedCan you paste your error message?
Starting from scratch might be a good idea
Comment #39
tgshannon commentedI am starting from scratch. I updated my first post with a question about the order of the breakpoints. What is the correct order? Mobil to Wide as breakpoint module suggests, or largest to smallest as the picture module suggests? I'm using an Omega sub-theme if that matters.
UPDATE: I started from scratch. I am not getting the error. However, using the mobil first order the pictures are not being responsive. I think this is because the mobile media query (min-width: 0) is matched first. I think I also need to set a max-width parameter on the breakpoints, or perhaps order from largest to smallest order as the picture module suggests, but the breakpoint module cautions against.
Comment #40
attiks commentedPicture will use the first match, so when using min width make sure the smallest is last, when using max width make sure smallest is first.
Comment #41
attiks commentedBTW you don't have to delete the breakpoint group, you can re order them and save, next you have to re save the mapping
Comment #42
tgshannon commentedWorking. I tried to reorder and save, but the old order returns after I loaded the node again. I needed to change the order in the theme.info file also i think. So, I think the picture module is correct about the order from "largest" to "smallest", but all of the examples and videos have it wrong. There are several ways to fix this I think: order largest to smallest using min-width media queries. Order smallest to largest using max-width media queries?? Include both the min and max width in the media query?
Since this is all a little new to me, I guess I didn't recognize a solution right off.
Comment #43
attiks commentedYou're right you have to change them in the theme, or override them first using the UI. Theme is the better approach.
Comment #46
aanjaneyam commentedI user aegir stack from omega8.cc. I just upgaded my entire site (via migration). During the courese of this upgrade I upgraded Picture module from 7.x-1.2 to 7.x-2.4 and I am getting this error. I cannot even access any page of the site so there is no way reordering any mapping or doing anything else. I cannot log in to the site. I there a certain upgrade process that should be followed fro picture 1.x to 2.x. I tried the 7.x-2.x+3-dev too but to no avail.
Comment #47
jstoller@aanjaneyam, I assume your picture mappings are in features. Can you manually edit the configuration in your feature, changing 'picture_group' to 'picture_mapping'? Then try reverting the feature via drush. I think that might work.
Comment #48
aanjaneyam commented@jstoller , I have a feature which may have picture_mappings I will check that. But, I have many content types with each having few core image fields and they have picture_group as mapping in their displays. How would that get handled in upgrade.
Comment #49
aanjaneyam commentedI tried it. I have one feature with only one of its file making a single mention of the word picture_group. I changed this instance of picture_group to picture_mapping ran drush fr , drush cc all. The fatal error is still there preventing me from doing nything. The content of the file that contantained word picture_group (now edited) is:
Comment #50
aanjaneyam commentedI disabled the feature but still no change. There is no documentation on upgrade process???
Comment #51
attiks commentedThe update process is just running update.php or drush updb, did you try running drush updb on the migrated site to see if all updates are processed?
What kind of error do you get?
Comment #52
aanjaneyam commented@attiks, yes did drush updb again after migration despite the migration process itself runs drush updb to upgrade the site from one platform version to other. The error I am geeting is:
Recoverable fatal error: Argument 1 passed to picture_get_mapping_breakpoints() must be an instance of PictureMapping, boolean given, called in /data/disk/c1/static/mop-prod-7.28.1-p001/sites/all/modules/contrib/picture/picture.module on line 528 and defined in picture_get_mapping_breakpoints() (line 1364 of /data/disk/c1/static/mop-prod-7.28.1-p001/sites/all/modules/contrib/picture/picture.module).Comment #53
aanjaneyam commentedJust getting WSOD.
Comment #54
attiks commentedDo you have the same problem if you do a manual update to picture 2?
Comment #55
aanjaneyam commentedI havent' tried manual update. I can try that. Is it possible to downgrade picture to 1.x and the manually upgrade to 2.x.
Comment #56
jstoller@aanjaneyam: Looking at your code from #49, the picture_mapping property of bean-image-field_image is empty. Try manually setting it to the machine name of the picture mapping configuration you want to use for that field and reverting the feature again.
Comment #57
aanjaneyam commented@jstoller thanks!!! Your advice #56 fixed the fatal error and I can now see the site. I don't know how the picture_mapping was empty even though in the previous version of the site picture_group was showing selected in the UI.
Comment #58
attiks commentedClosing this, in case of problems open a new issue