There is a new version of the "state" patch for pathauto available here:

https://drupal.org/comment/8674137#comment-8674137

And according to @plethoradesign this fixes an issue with Panopoly:

I'm using Panopoly and was unaware that the patch from #130 was included. I was having an issue when customizing pages with the in-place editor, where it would reset the page's alias automatically afterwards. I tested the patch from #178 and that fixed it for me.

Comments

dsnopek’s picture

Title: Update "state" patch to pathauto » Update "persist" patch to pathauto
caspervoogt’s picture

Steps to recreate the issue;

- create a page and give it a custom alias. Having "Generate automatic URL alias" checked or unchecked seemed to make no difference.
- go to this page and click "Customize this page" button.
- make some changes and save
- it returns me to the page, with its correct alias that I set previously.
- I visit the page again or reload it, and at this point it reverts to its auto-generated alias rather than the one I set manually. I then have to edit the page (with the usual Edit tab rather than using Panopoly) and set its alias manually again, and because I have the Redirect module enabled I also need to remove the redirect pointing to itself, which causes an infinite loop.

I did apply the patch from https://drupal.org/comment/8674137#comment-8674137 and that solved it for me.

lsolesen’s picture

Here is a Behat test for path auto where I tried describing your use case. https://github.com/lsolesen/panopoly/blob/pathauto/tests/behat/features/...

However, I cannot get the test to fail. Did I do anything wrong with it?

@api @javascript
  Scenario: Retain alias when using IPE - Issue #2239847
    Given I am logged in as a user with the "administrator" role
    And Panopoly magic live previews are disabled
    When I visit "/node/add/panopoly-page"
    And I fill in the following:
      | Title               | Testing title           |
      | Permalink           | my-ipe-custom-permalink |
      | Editor              | plain_text              |
      | body[und][0][value] | Testing body            |
    And I press "Publish"
    Then the "h1" element should contain "Testing title"
    Then the url should match "my-ipe-custom-permalink"
    When I customize this page with the Panels IPE
      And I click "Add new pane"
      And I click "Add text"
    Then I should see "Configure new Add text"
    When I fill in the following:
      | Title   | Text widget title       |
      | Editor  | plain_text              |
      | Text    | Testing text body field |
      And I press "edit-return"
      And I press "Save as custom"
      And I wait for the Panels IPE to deactivate
    Then the url should match "my-ipe-custom-permalink"
    When I click "View" in the "Tabs" region
    Then the url should match "my-ipe-custom-permalink"
dsnopek’s picture

@lsolesen: I haven't tried this myself, but just based on @plethoradesign's steps above, I think you need to reload the page after waiting for the Panels IPE to deactivate.

lsolesen’s picture

@dsnopek I thought it would be the same to just click View. Not failing even thought I change to " When I reload the page"

dsnopek’s picture

@lsoleson: Ah, you're right clicking "View" would be the same! Sorry, I missed that. :-)

caspervoogt’s picture

" I think you need to reload the page after waiting for the Panels IPE to deactivate."
Yes, after reloading the alias gets changed, at least for me prior to the patch at https://drupal.org/comment/8674137#comment-8674137 .

I would say though, as far as testing goes... I was dealing with an existing node that I was editing. Not adding a node. Don't know if it makes a difference. My node already had an alias, which I wanted to leave alone, but editing via Panels "Customize this page" and then saving "as custom" even after making no changes, then reloading the page caused the alias to revert to an automatic alias.

dsnopek’s picture

An idea just came to me with regard to the Behat test: maybe the reload is "working" but it's giving a 404 page?

@lsolesen: Can you check for more than just the URL after reloading? Or maybe even try to click the "Edit" tab and verify that the field has the correct value?

lsolesen’s picture

      And I wait for the Panels IPE to deactivate
    Then the url should match "my-ipe-custom-permalink"
    When I reload the page
    Then the url should match "my-ipe-custom-permalink"
    When I click "Edit" in the "Tabs" region
    Then the "path[alias]" field should contain "my-ipe-custom-permalink"

Makes no difference. Do not have time to create a patch, but the test is available on https://github.com/lsolesen/panopoly/blob/pathauto/tests/behat/features/... if you want to try it.

Maybe pathauto used to not really save the path properly (hence pathauto_persist), but it has been fixed in the version Panopoly is using now, so we can not get it to fail?

dsnopek’s picture

Thanks, @lsolesen! I'll give it a try this weekend. :-)

dsnopek’s picture

@plethoradesign: Following your steps in #2, I'm unable to reproduce this error by hand with a fresh install of Panopoly 1.2. Can you confirm that you can reproduce on plain Panopoly 1.2? Or does it only happen your built out site with other modules and configuration?

dsnopek’s picture

I just want to note: whether or not we can reproduce this problem, we probably should review the new patch on the pathauto issue and RTBC it again if the changes look good. Unfortunately, the author of the new patch didn't include an interdiff which makes it a little harder to review.

caspervoogt’s picture

@dsnopek. I haven't yet had a chance to try on a fresh, plain Panopoly 1.2. So it is entirely possible this is down to odd interactions with some other module(s).

dsnopek’s picture

There was just an even newer version of this patch added here:

https://drupal.org/node/936222#comment-8770937

This version MAY fix an upgrade issue that has plagued us for a really long time: #2164193: Upgrade from 1.0-rc5 fails: Table 'pathauto_state' doesn't exist

dsnopek’s picture

Status: Active » Fixed

I tested the new patch and it not only works just fine, it also helps with the upgrade issues!

Committed. :-)

  • Commit 299412d on 7.x-1.x by dsnopek:
    Update Panopoly Core for #2239847: Update "persist" patch to pathauto.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.