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

Path to overwrite is generated wrong #2

Closed
DanieliMi opened this issue Mar 24, 2022 · 8 comments · Fixed by #3
Closed

Path to overwrite is generated wrong #2

DanieliMi opened this issue Mar 24, 2022 · 8 comments · Fixed by #3

Comments

@DanieliMi
Copy link
Contributor

PHP classes (overrides) won't display. I generated the autoload files with composer dump, generated the classmap.json with php -r "\$classmap=require_once('vendor/composer/autoload_classmap.php'); echo json_encode(\$classmap);" > classmap.json and then started the electron app and selected the projects directory. The paths in the classmap.json are absolute but the project path is still prepended so the file cannot be found and it results in "Could not find contents of /path/to/file".

Here the entry from classmap.json:

"Mirasvit\\Core\\Plugin\\UrlRewritePlugin": "\/home\/dga\/projects\/example.com\/vendor\/mirasvit\/module-core\/src\/Core\/Plugin\/UrlRewritePlugin.php",

Result:
wrong_path_example

@peterjaap
Copy link
Contributor

You're correct. We have accommodated for the setup we use but nothing outside of that.

Our absolute paths are for example /data/clientname/magento2/vendor/php-parallel-lint/php-parallel-lint/src/Output.php and we strip off the /data part here and here. If you're willing to do a PR for a fix that would cover both scenarios, I'd be happy to merge it!

@DanieliMi
Copy link
Contributor Author

@peterjaap I'm happy to do a PR. I am wondering what your intention is with the copyPasteableFilePath is. What does http://localhost:8091?message=' + copyPasteableFilePath do? For me it simply opens this url in the electron app and has no result but a blank page.
I am not quite sure why you added the fixPath method, since the classmap.json contains absolute paths anyway it does not seem to be needed. I am asking because I do not want to break your workflow.

@DanieliMi
Copy link
Contributor Author

Ah I see the fixing is needed for all files that are no PHP classes. Okay I get that part now ;)

DanieliMi added a commit to iMi-digital/magento2-upgrade-gui that referenced this issue Mar 25, 2022
@peterjaap
Copy link
Contributor

@DanieliMi the copypasteablepath is clickable when you have the PhpStorm plugin Remote Call installed. It will open that file in your IDE.

@DanieliMi
Copy link
Contributor Author

@peterjaap ah that's pretty cool! Then it should be no problem, actually be good, to use the absolute path here as well. The absolute path cannot be ambiguous.

@peterjaap
Copy link
Contributor

@DanieliMi actually we need relative paths there because we run everything in Docker containers so the absolute path in the container does not correspond to the absolute path on my machine.

@DanieliMi
Copy link
Contributor Author

@peterjaap I see. And for that you need the data/ part removed.

@peterjaap
Copy link
Contributor

Exactly

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.

2 participants