Typo3 plugin not working in draft-workspace - plugins

I have a selfmade T3-plugin that actually works fine.
Unless I try to look at it in the draft-workspace - then I get an error saying «Template could not be found at "typo3/sysext/workspaces/Resources/Private/Templates/Preview/Preview.html"» (of course, the template is there).
We're working with T3 6.1.8
There were some rollbacks made recently that might have caused this, but that's just a wild guess...
Any ideas what could cause this?

The solution to this was actually quite trivial.
The person who wrote the extension used chdir() in the extension's header to write a PDF file. This confused the workspaces plugin so it didn't find it's own directory anymore.

Related

Typo3 8.7: Could not analyse class: maybe not loaded or no autoloader? Keeps coming and going

I have had this problem as seen in the title in the past and I always resolved this issue by adding the psr-4 autoloader in the emconf and simply reactivate my extensions.
Now I'm facing the same problem:
Could not analyse class: maybe not loaded or no autoloader?
but I have set the autoloader correctly as always. This also happens in more than one Extension right now.. After deleting the php cache in the install tool und dump autoload and reactivating my extension, the error was gone for some time, a couple hours later its back again.. Therefore I think it must have something to do with temp files, but I can't figure out what it is exactly..
Does anyone have a solution? I have seen plenty of topics about this issue on stackoverflow, I used them in the past, but unfortunately none is working for me right now.
Important fact: This error is happening on my new server now. On my old server (with the same code in the extensions) this didn't occur and they worked fine.
Thanks in advance.
Edit: Vendornames etc. are set correctly and there are no errors in the syntax whatsoever. As I said, the extensions worked fine.
Edit2: I just found this changelog of Typo3:
https://docs.typo3.org/typo3cms/extensions/core/Changelog/8.4/Breaking-78222-ExtensionAutoloadInformationIsNowInTypo3confautoload.html
But there is no solution for the impact for none composer installations. Can someone provide one for me?
When you use composer installation and you use extensions which are not installed via composer, you need to add the autoload information in the root composer.json of your project and then run composer dump-autoload. (ext_emconf.php dont works in composer mode?)
{
...
"autoload": {
"psr-4": {
"Vendor\\ExtensionNameA\\": "public/typo3conf/ext/extension_name_a/Classes",
"Vendor\\ExtensionNameB\\": "public/typo3conf/ext/extension_name_b/Classes"
}
}
}
A possible explanation for strange timing thing "works and later not". Maybe it has something to do with the red clear cache button in the TYPO3 backend (Clear all caches). Maybe it start not working when u hit this button and cache files get cleared. Then you need to reinstall extensions to get the autoloader "temporarly" working, till the point you hit the clear all caches button again. With the solution i mentioned above, it works permanet.
Have you left any configuration in your ext_tables.php?
As the TCA configuration, which is cached, is expected in Configuration/TCA/[Override/] any code in ext_tables.php might get lost.
If you want some configuration to be executed for each run you need to put it in ext_localconf.php
Thanks for all the help, I found the solution myself now.
Actually it was not really caused by any autoloader configuration, but and old version of fpdf which apparently caused two extensions to not load their classes properly. The exception thrown was simply misleading. I have upgraded the version of fpdf and now it works properly. It is not clear to me why the same code worked a week ago and now it failed, but atleast I have found the solution to my problem.

Groovy debugger out of sync

I am having a difficulty while attempting to debug some code in grails. It is difficult to put into text, so I have posted a screencast showing exactly what the problem is here. In short, while I am debugging the debugger starts jumping from place to place and not following the program logic I have in place. The only other similar question I have found is a year old, had no solution, and can be found here.
The best guess I have so far is that the debugger is displaying the text I have typed in, but is actually executing an older version of the class file which it has cached somewhere. Therefore, I tried:
cleaning the project
manually deleting all of the class files from the target folder and from the target-eclipse folder
Searching my entire hdd for additional files with similar names
removing my project from the workspace and re-adding it
closing and reopening the IDE
grails refresh-dependencies
Importing the project into a new IDE (I was using GGTS, I switched to IntelliJ)
None of those solutions had any effect. I realized that the issue was in a .groovy file, and I was writing almost pure Java, so I deleted the .groovy file, and re-created the class in a .java file. That solved my problem. Unfortunately I am having the problem again, and this time it is in a controller that heavily relies on the grails framework, so that solution is not an option. Other than also being in a .groovy file, another similarity is that the code breaks on an if statement.
My next steps:
Verify that the application is not executing the code I see by using print functions to monitor actual execution flow.
comment out the entire function and re-add functionality one line at a time to see if I can see what breaks it.
Delete the .groovy file, and re-create it as another .groovy file.
Any help is appreciated, and since I can't find any answers online I will continue to update this question as I learn more.
See my comment on the jira issue that you raised. You have found a problem with the groovy compiler and how it calculates line numbers. This is not a problem with executing the wrong class files or using a broken debugger. The debugger is doing exactly what it is expected to do. It is the compiler that is providing erroneous line number information.
The next step, as described in the issue, is to provide a simple project that recreates the bug. I tried to do so myself, but could not. So, please supply something that we can work with. Then we can notify the groovy compiler team.

tinyMCE - tinymce-rails - asset precompile woes

I am really stumped by how to deploy tinyMCE. Precompile on it fails and so I get the
We're sorry, but something went wrong. - error.
I tried using tinymce-rails gem but just couldn't get it to work even in development by following all the instructions on the github page exactly. Wish there was a slightly verbose manual. I particularly couldn't get the partials with formbuilder code to work with it.
I think if I simply copy tinyMCE original js code to public/javascripts/tinyMCE and have enginx serve the static files it should work but I still need it in development and couldn't get rails to work with it that way. Still the roadblock is the precompile error from capistrano which causes the above error.
I even tried tinymce-hammer but couldn't get it to work either. Is there a single file, simple rich text editor?
I have to get this done today and so I am scrambling.
I would welcome any solutions...but please include as much detail, or urls. Thanks a bunch.

Problems with finding Three20 Header Files for iPhone App

I am trying to create an app using three20 for a photo viewer. When I follow the instructions on their site (which is now simply running a python script) it seems to behave correctly but then when I try to build I get a "No such file or directory" error for using #import <Three20/Three20.h>.
I am pretty sure the header search path is correct, but I can't seem to get it working, even when I follow exact tutorials online.
Has anyone seen this problem before and know how to fix it?
Have you checked to make sure you actually have added three20 into your dir. as I remember having a similar problem, when I tried to use three20 which was due to the fact it wasn't in the right place, when I thought it was.
It sounds like you haven't imported the files correctly. Have another look at where you added the files to you project, if you have at all. (If not, you need to drag them into your project first!)
If you try to compile the project without the file added to the project, it will fail. Simply adding a path is not enough.
You need to drag it into Xcode...
Add it to the project...
And then your code should build.
I hope this helps!

NetBeans PHP code completion for own code

Recently I started using NetBeans 6.7 beta for PHP development instead of Textmate and MacGDBp. I am rather amazed with it's feature set and most everything worked out of the box, or was easily configured to my liking.
I am having an issue with the code completion features though; they work for built-in functions, SPL and some of my code, but not all of my code, specifically, it never works for any methods in my classes, regardless of PHPDoc comments.
I can't seem to find any decent questions, let alone answers about this specific subject anywhere. It looks like everybody else who has problems with the code completion just hasn't enabled the auto-popup feature.
So the big question is:
Is there any way to influence the code completion cache, or something I have to add to my code to make it work? I'd really like to have code completion for the methods I write.
PS: I have tried several older versions of netbeans, they all exhibit the same problem.
edit: I've put a .zip up of my current test project. get it here. It's a very young project, think a day and a half.
edit2: Below is a screenshot of what i'm looking at. As you can see, it fails to complete pretty much anything, nor does it see the PHPDoc documentation.
I've tried opening your project, and the completion seems to be working just fine for me.
The only thing I can think of is to try to delete your entire NB cache, which should be located in $HOME/.netbeans/$VERSION/var/cache/. This is a wild guess
Create a backup first, I didn't try this!
If that fails, maybe you should try creating a new project, maybe that will kick NB in the butt.
Note that in NB 7.2 beta, the cache has moved to $HOME/.cache/netbeans/$VERSION.
What worked for me was deleting the old nbproject folder (that was created in windows) and recreating the PHP project from existing sources. This is on NB 7.0.1 Mac OS X. Clearing the cache did not work for me.
Be aware of #property something syntax. If object something does not exists in your code anymore, NetBeans might have problems with proper code completion. Consider example:
/** in main file: **/
use ABC as _ ;
/** in file ABC: **/
/**
* #property \Something $something
*/
If you do not use $something anymore, NetBeans will most likely generate an exception, thus failing to complete the code.
What worked for me was clearing the cache, then explicitly including some key subdirectories in the Global include path. Appears that for some reason NB 6.7 wasn't recursing the directories.
Including at project level also worked
Project->Properties->Include Path
Netbeans 7.01 + Windows 7
If, for instance, you open a php file with netbeans without being part of a project, code completion doesn't work at all. What you need to do is to create a project having that file in it.
Tested this on NetBeans 7.0.1