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

Original hash changing after reload #131

Open
brchristian opened this issue Jul 18, 2014 · 6 comments
Open

Original hash changing after reload #131

brchristian opened this issue Jul 18, 2014 · 6 comments

Comments

@brchristian
Copy link

I'm having a hard time getting the :original hash for my Deface overrides to work correctly. It appears that the hash changes with every reload!

For instance, I wanted to override the following <h1>:

https://github.com/spree/spree_auth_devise/blob/2-2-stable/lib/views/frontend/spree/users/edit.html.erb#L4

So I wrote the following override:

Deface::Override.new(
  name: "edit_account_replace_title",
  virtual_path: "spree/users/edit",
  replace: "h1",
  text: "<h2>Edit Account</h2>"
)

However, I keep getting Deface warnings about needing an original hash:

Deface: 1 overrides found for 'spree/users/edit'
Deface: 'edit_account_replace_title' matched 1 times with 'h1'
Deface: [WARNING] No :original defined for 'edit_account_replace_title', you should change its definition to include:
 :original => 'a133eade5c9cf2b42192fcc1c6f5472ff6c29312' 

Reload...

Deface: 1 overrides found for 'spree/users/edit'
Deface: 'edit_account_replace_title' matched 1 times with 'h1'
Deface: [WARNING] No :original defined for 'edit_account_replace_title', you should change its definition to include:
 :original => '4e8af3b95c73312b6f5452dddf2dacd6f96c5daf' 

Am I missing something and am simply doing this wrong? The line that I'm overriding isn't dynamic, so what might be causing the hash to change like this?

@msevestre
Copy link

I have exactly the same issue.

@BenMorganIO
Copy link

Same

@msevestre
Copy link

Is deface not supposed to be used anymore?

@BDQ
Copy link
Member

BDQ commented Oct 20, 2014

This is a new one for me, I'll take a look and see if I can replicate.

@magicienap
Copy link

I know this issue was opened some months ago, but for people who have the same problem, it seems to be fixed (discussed in issue #130).

I had the same issue because the version of Deface I was using was too old...

@felixbuenemann
Copy link

Yepp, this is fixed by #130.

@BDQ Could you release a deface 1.0.1 version with all the fixes from master?

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

No branches or pull requests

6 participants