Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Dirty State? #120

Closed
intrepidws opened this issue Apr 14, 2022 · 5 comments · Fixed by #164
Closed

Problem with Dirty State? #120

intrepidws opened this issue Apr 14, 2022 · 5 comments · Fixed by #164

Comments

@intrepidws
Copy link

As part of upgrading to Statamic 3.3, I also upgraded from v2.9.3 of this package to v2.11.0. I am running into an issue that I believe traces back to usage of the responsive fieldtype made available by this package.

There are two issues occurring:

  • When I make a responsive fieldtype required, it doesn't actually get required
  • When I do select an image for the responsive fieldtype, and then try to save the collection item, I get a browser notification similar to what I would get if I were leaving the page before saving. See the below screenshot.

Screen Shot 2022-04-14 at 1 26 28 PM

I am running PHP 8.1, Laravel 8.83.8, Statamic 3.3.6 and Statamic Responsive Images 2.11.0.

Author Collection Blueprint YAML

title: Authors
sections:
  main:
    display: Main
    fields:
      -
        handle: title
        field:
          type: text
          required: true
          validate:
            - required
          display: Name
          listable: true
          input_type: text
          antlers: false
      -
        handle: job_title
        field:
          input_type: text
          antlers: false
          display: 'Job Title'
          type: text
          icon: text
          listable: true
      -
        handle: header_photo
        field:
          use_breakpoints: false
          allow_ratio: false
          allow_fit: true
          breakpoints:
            - sm
            - md
            - lg
            - xl
            - 2xl
          container: assets
          folder: headers
          restrict: false
          allow_uploads: true
          display: Photo
          type: responsive
          icon: assets
          listable: hidden
          instructions_position: above
          read_only: false
          validate:
            - required
  sidebar:
    display: Sidebar
    fields:
      -
        handle: slug
        field:
          type: slug
          localizable: true
          validate:
            - required
          listable: hidden
          generate: true
@intrepidws
Copy link
Author

Note that if you do either of the below, you do not get the browser message:

  • Do not provide an image for the responsive fieldtype
  • Remove the responsive fieldtype from the collection blueprint

@spatie-bot
Copy link

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.

@ncla
Copy link
Collaborator

ncla commented Aug 15, 2022

Shoo, @spatie-bot. Both the dirty state and required validation are still broken. I have tested this, it is indeed broken, and there might be a fix soon.

ncla added a commit to ncla/statamic-responsive-images that referenced this issue Aug 16, 2022
riasvdv pushed a commit that referenced this issue Aug 27, 2022
@ncla
Copy link
Collaborator

ncla commented Aug 27, 2022

The dirty state issue should be improved with v2.13.1 update.

@intrepidws
Copy link
Author

Hey @ncla, I finally got around to testing this and just wanted to thank you for fixing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants