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

[bug] notices in frontend on first pageview after cache clear #5084

Closed
jadwigo opened this issue Mar 25, 2016 · 6 comments
Closed

[bug] notices in frontend on first pageview after cache clear #5084

jadwigo opened this issue Mar 25, 2016 · 6 comments
Assignees
Labels
blocking release bug A bug that has been verified

Comments

@jadwigo
Copy link
Contributor

jadwigo commented Mar 25, 2016

When you clear the cache (after a code change / update to bolt) and you have a configuration that has relations between content types you will get a list of notices at the first page refresh after you have cleared the cache. (There must obviously be some records in the database that have relations set)

The notices will be gone after the first pageview.

It happens in the front-end on any page. Notices look like:

"Notice: Undefined index: fromcontenttype in [..]/vendor/bolt/src/Storage/Field/Type/IncomingRelationType.php on line 68"

image

The notices repeat a few times, and after that the page is rendered normally underneath.

Details

  • Relevant Bolt Version: 3.0 / master
  • Install type: Github checkout and the others probably
  • PHP version: 5.6
  • Used webserver: Apache and Nginx
@jadwigo jadwigo added the bug A bug that has been verified label Mar 25, 2016
@bobdenotter bobdenotter self-assigned this Mar 29, 2016
@bobdenotter
Copy link
Member

I cannot reproduce this. Can you, @jadwigo ?

@bobdenotter
Copy link
Member

I have some additional info on this.. If I do dump($data) in public function hydrate($data, $entity) in IncomingRelationType.php, I get the following:

screen shot 2016-04-04 at 17 22 54

Where it seemingly goes wrong, is that the fromcontenttype values seem to be unique. Instead of having three pages, two structures and one pressreleases, I get one of each. See the screenshot with data from the DB:

screen_shot_2016-04-04_at_17_27_33

@rossriley: Is this something you could look into?

@bobdenotter
Copy link
Member

Digging deeper, if I do this in find in Repository.php

        $result = $qb->where($this->getAlias() . '.id = :id')
            ->setParameter('id', $id)
            ->execute()
            ->fetch();

        dump($result);

I get this:

  "_incomingrelation_id" => "3,17,36,38,65,66"
  "_incomingrelation_fromid" => "22,27,19,3,1"
  "_incomingrelation_fromcontenttype" => "pages,structures,pressreleases"

Seems like that's where the issue is coming from.

@bobdenotter
Copy link
Member

Ok, i'm stumped! :hurtrealbad:

@rossriley
Copy link
Contributor

OK. I know what this one is. Fixed the same problem with the repeaters. PR incoming.

@bobdenotter
Copy link
Member

Fixed by #5128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking release bug A bug that has been verified
Projects
None yet
Development

No branches or pull requests

3 participants