Problem/Motivation

When adding an article I get the error Notice: No file uploaded in Unknown on line 0 returned.

This also results in the following dblog message

<em class="placeholder">RuntimeException</em>: Failed to start the session because headers have already been sent by &quot;&quot; at line 0. in <em class="placeholder">Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage-&gt;start()</em> (line <em class="placeholder">144</em> of <em class="placeholder">/var/www/drupal/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php</em>).

This does not happen on the Basic Page content type, so assume it relates some how to the image field.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

timmillwood’s picture

Title: Error adding articles on PHP 7 » Error adding articles on PHP 7 with no image

One thing I forgot to add, articles can be added find if an image is uploaded. This error only happens if field_image is empty.

Berdir’s picture

Weird. Since php7 changes a lot, can you add the exact build time/version (alpha, beta, ...) ?

timmillwood’s picture

PHP Version 7.0.0-dev
System: Linux php7dev 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64
Build Date: May 25 2015 16:34:08

Downloaded the php7dev vagrant box, then compiled the latest PHP 7 build with the makephp 7

Running the full set of tests on it now so I can update the parent issue.

Berdir’s picture

That build date is from your os? php --version should give you a build date for PHP7 itself: "PHP 7.0.0-dev (cli) (built: Jul 4 2015 14:21:57)".

But latest I guess means you built it today ;) Can you try to run the image field related tests to see if they fail or pass?

Alan Evans’s picture

I've been unable to reproduce this bug using this PHP version:

$ php --version
PHP 7.0.0RC2 (cli) (built: Sep 17 2015 21:30:00)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

Just to check the steps I attempted to reproduce:

  • Install PHP7
  • Install D8 using PHP7
  • Confirm the status report on the site shows PHP7 (I'd had a little trouble getting php7 picked up, so needed to confirm this)
  • (made no configuration changes on the site after install)
  • Create an article with no added image
  • No issues - article is created

I'd suggest that this can be closed and we can reopen if anyone is able to reproduce on latest PHP versions.

alexpott’s picture

Status: Active » Closed (cannot reproduce)
PHP 7.0.0RC5 (cli) (built: Oct 22 2015 17:47:23) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies

I can't reproduce this either - i created articles both with and without an image.

luuph’s picture

This happens if PHP is compiled with debug enabled. See - https://bugs.php.net/bug.php?id=60808 and https://bugs.php.net/bug.php?id=70243