Skip to content

Augmented taxonomy entries site url error #1825

@mikemartin

Description

@mikemartin

Bug Description

When listing taxonomy entries, I'm hitting an absoluteURL() error when the augmented entries are being returned.
Call to a member function absoluteUrl() on null

I've narrowed the error down to the site_url config in the absoluteUrl function in vendor/statamic/cms/src/Routing/Routable.php on line 49. My temporary workaround is replacing $this->site()->absoluteUrl() with env('APP_URL', '/'). Error log gist is attached below.

vendor/statamic/cms/src/Routing/Routable.php:

public function absoluteUrl()
    {
        if ($this->isRedirect()) {
            return $this->redirectUrl();
        }

        return vsprintf('%s/%s', [
            rtrim($this->site()->absoluteUrl(), '/'),
            ltrim($this->uri(), '/'),
        ]);
    }

Content:

sections:
  -
    type: zones
    enabled: true
    zones:
      - the-storm-zone
      - the-rain-zone
      - the-cloud-zone

Fieldset:

title: Zones
fields:
  -
    handle: zones
    field:
      mode: default
      type: taxonomy
      localizable: false
      listable: hidden
      display: Zones
      taxonomy: zones
``

Template:
{{ zones }}
     {{ title }}
{{ /zones }}

## How to Reproduce

## Extra Detail
<!-- Screenshots, template code, or exception error message/link -->
**Error log**: https://gist.github.com/mikemartin/7b3f620b65c9c34ba04535c4df45fa44


## Environment

**Statamic version:** 3.0.0.-beta-28

**PHP version:** 7.{?}

**Install method (choose one):**
- Fresh install from `statamic/statamic`
- Starter kit
- Existing Laravel app
- Other (please explain this magic!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions