Exception: Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed in serialize() (line 14 - serialization

I am using the latest update of Drupal 9. For some reason when I install any NEW module that involves uploading images, It goes through the motions of uploading but does not save image. The images don't show up on the content from the module. And when I go back to look at it, the image is blank like I never uploaded an image. So I checked my error logs.
Here is the error in the log:
Exception: Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed in serialize() (line 14 of /home/xxxxxx/public_html/xxxxxxxx/core/lib/Drupal/Component/Serialization/PhpSerialize.php).
How do I fix this?
I tried asking drupal forums, No answer. I tried google. Nothing helped. I'm not that familiar with serialization.

Related

Strongname Signing IKVM PDFBox for Word Addin

for a Word Addin I am using PDFBox to manipulate PDFs. Or rather I would like to use it. I used it before with a self-created Desktop App. PDFBox is a Java Library that can be made usable as DLLs with IKVM (like here: http://www.squarepdf.net/pdfbox-in-net ). The problem that I experience is that all libraries for Wordaddins must be strongnamed. I tried to strongname sign but then I get an exception that a part of apache common logging (in directory MANIFEST.MF) cannot be found.
I know this is pretty vague so far and I will post more details later on, but maybe someone already went through this and has an idea on how to do this right or can point me to some place where there is already a strongnamed version of PDFBox.
Thanks in advance!
I will give some more information to this question, because my colleague is in holiday. I have strong named all pdfbox-dlls and on the try to open a pdf, i will get the first FileNotFoundException. The File $(PrjectDir)\bin\x86\Debug\commons-logging.properties could not be found.
All following Exceptions has the same problem. As a sample the next exception is a DirectoryNotFoundException. It could not find \bin\x86\Debug\META-INF\services\org.apache.commons.logging.LogFactory . There are more than 10 FileNotFoundExceptions only at the opening of my PDF:
doc = PDDocument.load(new File(inputFile));
All of Them can't find something of the Logger.
In the next Step, i try to make a content Stream from the first page of that pdf:
contentStream = new PDPageContentStream(doc, (PDPage)doc.getDocumentCatalog().getAllPages().get(0), true, false);
The first Exception, i will become there is another FileNotFoundException for C:\Users(user).accessibility.properties or $(ProjectDir)\bin\x86\Debug\META-INF\services\java.text.spi.NumberFormatProvider
Until this point, i have 20 Exceptions or so. The most of them can't find something of the logger. But i can write the opened pdf to the harddisk. If i try to insert some text into contentstream, i get a harder Exception at the point i have to set the font:
PDFont font = PDType1Font.HELVETICA;
contentStream.setFont(font, 10);
At this point i get following Exception:
An exception (first chance) of type "System.TypeInitializationException" occurred in fontbox-1.8.12.dll.
Additional information: The type initializer for "org.apache.fontbox.cmap.CMap" generated an exception.
I think the references has a problem, if pdfbox is strong named. Has anybody an idea, what is to do? Thank you very much.

Can't get PDFBox CreatePDFA example to work - Color profile not found

I'm trying to get the example for creating a PDF/A document with Apache PDFBox up an running (CreatePDFA.java).
For this I copied the example class as is into a project module that includes a maven-dependency on PDFBox in version 2.0.0-RC3. I only changed the method signature and used a fixed font, filename and message instead of args[].
When trying to run the code I get an NPE in Line 107 because it cant't load the color profile (InputStream is null) When I check the included library in the project details I can see the resources folder, but it does not contain the expected file, namely "pdfa/sRGB Color Space Profile.icm".
Unfortunately, google-ing the problem only turned up more references to always the same example implementation, but after a while I acutally found what seems to be the needed file on apache.googlesource.com
I copied the file to our own resource directory and then used this line of code instead:
InputStream colorProfile = CreatePdfA.class.getResourceAsStream("/pdfa/sRGB Color Space Profile.icm");
This finally stopped the NPE - the file is apparently found - but now I get another exception which says:
java.lang.IllegalArgumentException: Invalid ICC Profile Data
Here, I'm stuck. I had hoped that this would work just out of the box, but it seems like I am missing something. Any ideas?
You already answered one part of the problem yourself: put the file into your resource directory.
The second problem may be a bad repository mirror or a transfer problem (binary to ascii). Here's the official repository URL with the ICC profile from the example:
https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/resources/org/apache/pdfbox/resources/pdfa/

Xcode 5 invalid image path error

Im relatively new to programming and am just in the process of uploading my first app to the app store however i am getting the following error message which i just can't figure out / fix. I have looked everywhere online for a solution but as yet, no luck. Please can someone help? I am using Xcode 5:
Error:
ERROR ITMS-9000: "Invalid Image Path - No image found at the path referenced under key 'CFBundleIcons': 'AppIcon40x40'" at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage)
This really doesn't mean anything to me as i have tried all the usual asset catalogue stuff / looked at my p-list.
You need an App Icon.
If you created the project in Xcode 5 then there should be a catalogue called Images.xcassets where you should place the icons of the correct sizes for your app.
I have added a screenshot of my app as an example of what I am talking about:
I saw the same error. First I thought that the images where not correct (I found one with 144 dpi), but the error showed up again.
Just search for the exact name "AppIcon40x40" in the whole project using Shift+Cmd+F. I have seen it referenced in a plist file under another key. There you have to change the names to the appropriate ones.

MediaElement Uncaught TypeError: Cannot read property 'tagName' of null

I would like to use MediaElement to serve all the videos/formats we have without creating different players. My first attempt was with an .mwv file with throws the error listed in the Title of this post. Next I tried an MP4 which seems to work fine. Then I tried an .flv file which also threw the same error listed in the title.
In Chrome I see "Uncaught TypeError: Cannot read property 'tagName' of null" the console which occurs in mediaelement-and-player.min.js at line 40 but the viewer part of the player doesn't display at all. In Firefox I see "TypeError: d is null" in the console at the same line number but the viewer part of the player DOES display and it says: "Video format or MIME type is not supported". The MediaElement documentation indicates that those types are supported but I can't seem to get them to play.
Either I mis-configured the player or I am passing the wrong content-type (I tried several) or this is a bug. I saw a similar post but the solution posted there was a little vague. I am going to try different files, formats and mime types to see if I can sort out the issue but I think this is a code problem. Ha anyone else been able to play flv or wmv files with mediaElement? Was there a trick to making it work?
I missed a step (or a directive) in the configuration. The 'tagName' error had to do with the content type I was using and was not defined in Glassfish. The reason that nothing was playing was that I forgot to list the class as "mejs-player" in the video tag.
Cleaning up those two things got the player working.

How to know if QLPreviewController successfully loaded a document/failed to load it?

My iOS app loads a variety of documents using QLPreviewController. My aim is to set a flag if the document loaded properly and show an error if it didn't.
Curiously the QLPreviewControllerDelegate protocol offers no callback to check this, nor does the QLPreviewController seem to throw any exception when I try to load an invalid file.
For the record, I tried loading an invalid PDF and it simply logged a message about not being able to find the header and displayed an empty file.
Can anyone please tell me how I can figure this out?
Thanks!
If establishing whether an item could be displayed beforehand works for you then a call to the following may be an option:
+(BOOL)canPreviewItem:(id<QLPreviewItem>) item