Page 1 of 1

Issue w/ Renaming Files

PostPosted: October 16th, 2018, 2:56 pm
by AndyM84
When I go to rename a PHP file while it is open AND I have VS try to "update the references", I receive the following popup:

you-shall-not-rename.png


It then lets me try renaming the file again without the prompt and completes the operation successfully.

Re: Issue w/ Renaming Files

PostPosted: October 17th, 2018, 9:06 am
by maros.beno
Hi,
thank you for your feedback.
What was the name of class/file you were renaming from and what was the name you were renaming it into please? I was unable to reproduce. When I try to rename simple file/class Class1 to Class2 everything works out great. Does this simple rename works for you as well and it only shows this error for some particular ones? Maybe when this class name is used in some particular place in other files?

Thanks again, have a nice day.

Re: Issue w/ Renaming Files

PostPosted: October 17th, 2018, 5:28 pm
by AndyM84
Let's see...

- I was renaming a file called 'LoginKey.php' to 'LoginKey.cls.php'
- The file in question was still new and hadn't been referenced anywhere yet
- This is probably the first time I've ever seen and/or chosen to use the "update references" dialog during a file rename
- Were you renaming the file it was open in the editor as well?

I'll try and reproduce again today at some point and let you know.

Re: Issue w/ Renaming Files

PostPosted: October 18th, 2018, 2:06 pm
by maros.beno
Hi,
the problem seems to be that PHP Tools was trying to rename "LoginKey" class to "LoginKey.cls" class. Strange is that it did not show me any errors when I tried to rename it. Yes i had the file open. But it results to invalid code after the renaming, because there will be "class LoginKey.cls" and such. Tell us if you manage to reproduce the error message somehow and I will take a look at it closer then. Next time just say no to renaming when class name really didn't change.
Thanks, Have a nice day.