deface
deface copied to clipboard
Original hash changing after reload
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?
I have exactly the same issue.
Same
Is deface not supposed to be used anymore?
This is a new one for me, I'll take a look and see if I can replicate.
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...
Yepp, this is fixed by #130.
@BDQ Could you release a deface 1.0.1 version with all the fixes from master?