data.isHome is not working since update

I updated the packages on my site, and since the update, data.isHome is undefined on my Hompage. My packages/my-theme/src/components/index.js looks like:

  const data = state.source.get(state.router.link)
  console.log(data.isHome) // undefined

My frontity.settings.js looks like:

... {
    name: '@frontity/wp-source',
    state: {
      source: {
        api: 'https://mywpsite/wp-json',
        homepage: '/home',

I also attach two screenshot about the npm packages, I changed lastly.


npx frontity info

System:

  • OS: Linux 5.4 Linux Mint 20 (Ulyana)
  • CPU: (8) x64 Intel® Coreâ„¢ i7-4810MQ CPU @ 2.80GHz
  • Memory: 5.54 GB / 15.54 GB
  • Shell: 5.0.17 - /bin/bash

Binaries:

  • Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node
  • npm: 6.14.8 - ~/.nvm/versions/node/v12.18.3/bin/npm

Browsers:

  • Chrome: 84.0.4147.105
  • Firefox: 80.0.1

npmPackages:

  • @frontity/core: ^1.9.0 => 1.9.0
  • @frontity/google-analytics: ^1.3.0 => 1.3.0
  • @frontity/head-tags: ^1.0.7 => 1.0.7
  • @frontity/html2react: ^1.4.0 => 1.4.0
  • @frontity/now: ^1.2.0 => 1.2.0
  • @frontity/tiny-router: ^1.2.1 => 1.2.1
  • @frontity/wp-source: ^1.9.0 => 1.9.0
  • eslint: ^7.10.0 => 7.10.0
  • eslint-plugin-react: ^7.21.3 => 7.21.3
  • eslint-plugin-react-hooks: ^4.1.2 => 4.1.2
  • frontity: ^1.12.0 => 1.12.0
  • frontity-chakra-theme: ./packages/frontity-chakra-theme => 0.0.2
  • react-facebook: ^8.1.4 => 8.1.4
  • react-fetch-hook: ^1.8.3 => 1.8.3
  • react-swipeable: ^5.5.1 => 5.5.1

npmGlobalPackages:

  • frontity: Not Found
  • npx: Not Found

System info copied in the clipboard!
You can now paste it in the Frontity Community or GitHub issue.

Hey @koli14, would it be possible to take a look at the code to figure out what is wrong?

Thanks in advance and sorry for the issue! :slight_smile:

Hi @luisherranz,

I’ve hit this issue too. data.isHome is not getting returned for the homepage but is gets returned true on the blog page.

Reproduced using mars-theme here: https://github.com/primitiveshaun/my-app

Hmmm… ok, thanks guys. It looks like it has to do with the homepage setting.

We’re going to investigate how this works in WordPress because in WordPress you have both is_home and is_front_page and I think we should match that exactly in Frontity with isHome and isFrontPage.

2 Likes

Hey, I opened an issue (https://github.com/frontity/frontity/issues/598) and fixed the bug right now. This is the pull request: https://github.com/frontity/frontity/pull/599

It was a bug actually, introduced in the latest version of @frontity/wp-source (1.9.0).

I’ll let you all know once it’s released!


EDITED: I moved the discussion to this thread: Make `wp-source` homepage settings and conditional tags to match WordPress

1 Like

3 posts were merged into an existing topic: Make wp-source homepage settings and conditional tags to match WordPress

@koli14, @shaun, we released a new version of @frontity/wp-source with the bugfix (1.9.1). Check it out!

To update it, just follow the guide about how to keep Frontity updated.