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

VersionPress with Elementor #165

Open
jawabuu opened this issue Apr 24, 2019 · 7 comments
Open

VersionPress with Elementor #165

jawabuu opened this issue Apr 24, 2019 · 7 comments

Comments

@jawabuu
Copy link

jawabuu commented Apr 24, 2019

Please be specific when describing the issue. Also, these details will help:

  • VersionPress version: 4.0-beta2
  • WordPress version: 5.1
  • OS, webserver, PHP: php7.3-apache
  • Git version: 2.11.0

I'm trying to use versionpress with elementor.
In my workflow all page edits are done on dev environments and pushed to live wordpress instance.
Here's a db entry in posts for a page in dev created with elementor it has id 33

33 1 2019-04-22 16:09:28 2019-04-22 16:09:28

Modernize Your Web Design

Te maior...

Home   publish closed closed   home     2019-04-22 16:11:24 2019-04-22 16:11:24   0 http://3A4D5537-B2F8-4C02-8F87-644E9C78E000 0 page   0

On pushing to live the id for the page is now 24

24 1 2019-04-22 16:09:28 2019-04-22 16:09:28

Modernize Your Web Design

Te maior...

Home   publish closed closed   home     2019-04-22 16:11:24 2019-04-22 16:11:24   0 http://3A4D5537-B2F8-4C02-8F87-644E9C78E000 0 page   0

Elementor creates css files on disk with the post-id appended i.e.
wp-content/uploads/elementor/css/post-33.css
which are committed by versionpress and pushed.

However on the live site since the post-id changes, the page on the live site is trying to reference
wp-content/uploads/elementor/css/post-24.css
which does not exist and breaks the page.

Is there a way to preserve file references for plugins?

Additional Info:

postmeta in dev
post_id: 33
meta_key: _elementor_css
meta_value: a:4:{s:4:"time";i:1555949618;s:5:"fonts";a:3:{i:0;s:11:"Fredoka One";i:1;s:6:"Nunito";i:2;s:7:"Poppins";}s:6:"status";s:4:"file";i:0;s:0:"";}

postmeta in live
post_id: 24
meta_key: _elementor_css
meta_value: a:4:{s:4:"time";i:1555949618;s:5:"fonts";a:3:{i:0;s:11:"Fredoka One";i:1;s:6:"Nunito";i:2;s:7:"Poppins";}s:6:"status";s:4:"file";i:0;s:0:"";}

@pavelevap
Copy link
Collaborator

Hi @jawabuu,

sorry, but this is not currently possible with VersionPress :-(

If I understand it correctly, there is no way to filter file names in Elementor to change it from post-ID.css to post-name.css or something else: elementor/elementor#3553

VersionPress tries to ignore original IDs to simplify development workflow, but some problems appeared, see for example related issue: versionpress/versionpress#1189

There is also a recent discussion related to tracking original IDs: versionpress/versionpress#1420

@jawabuu
Copy link
Author

jawabuu commented Apr 24, 2019

Thank you @pavelevap. Appreciate the great work you're all doing with versionpress and your quick response.
I'm looking for more of a workaround. I don't need the filenames changed, I'm thinking of an elementor schema.yml that would reference the file with the original id inspite of versionpress changing the id.
I believe this is what you do with the wordpress profile image?

@pavelevap
Copy link
Collaborator

I understand it, but Elementor probably generates files with original IDs which is a problem for VersionPress. Even if we could handle it on database layer (with schema.yml), for example change post-ID to post-VPID in database, then .css files would be still problematic (with different IDs on different environments). Sorry, I do not see any way to bypass it for now :-(

@jawabuu
Copy link
Author

jawabuu commented Apr 24, 2019

I understand. I think the only option for such scenarios would be a versionpress that preserves post-ids. Is there a branch that I can use that does this or an issue about preserving ids that I can track?
Many thanks.

@pavelevap
Copy link
Collaborator

Currently only this issue: versionpress/versionpress#1420

@jawabuu
Copy link
Author

jawabuu commented Apr 24, 2019

Alright, should I close this?

@jawabuu
Copy link
Author

jawabuu commented Apr 24, 2019

Hi @jawabuu,

sorry, but this is not currently possible with VersionPress :-(

If I understand it correctly, there is no way to filter file names in Elementor to change it from post-ID.css to post-name.css or something else: elementor/elementor#3553

VersionPress tries to ignore original IDs to simplify development workflow, but some problems appeared, see for example related issue: versionpress/versionpress#1189

There is also a recent discussion related to tracking original IDs: versionpress/versionpress#1420

Hey @pavelevap just found out that a filter for css filenames has been implemented for elementor here elementor/elementor#5968
Is this sufficient to solve my 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

No branches or pull requests

2 participants