Jump to content

PW 3.0: With a certain template, values for 'title' and 'name' disappear during creation of a new page


j__
 Share

Recommended Posts

Came across something strange, maybe anyone of you has seen this before: When I add a new page with template 'simple-page', ProcessWire asks for title and name in order to create the page. I populate the title field and wait for the name field to be filled automatically, i.e.: "Example" for page title and "example" for page name. When I click "Save", the page is being created, loading all other fields for this template. But the fields for title and name are empty again. (And since 'name' is empty, ProcessWire assigns a new name 'untitled' for this newly created page.)

  • Only happens with one template (see structure below)
  • On all new pages with other templates, 'title' and 'name' are assigned just as expected
  • Spotted in ProcessWire 3.0.62, this issue did not appear in an earlier version of the same site using ProcessWire 2.5.3

This is how the template is defined (tidied it up, there's 20+ fields):

{
    "simple-page": {
        "id": 47,
        "name": "simple-page",
        "fieldgroups_id": "simple-page",
        "flags": 0,
        "cache_time": 0,
        "useRoles": 0,
        "noInherit": 0,
        "childrenTemplatesID": 0,
        "sortfield": 99,
        "noChildren": "",
        "noParents": "",
        "childTemplates": [
            "special-page"
        ],
        "parentTemplates": [
            "home"
        ],
        "allowPageNum": 0,
        "allowChangeUser": 0,
        "redirectLogin": 0,
        "urlSegments": 0,
        "https": 0,
        "slashUrls": 1,
        "slashPageNum": 0,
        "slashUrlSegments": 0,
        "altFilename": "",
        "guestSearchable": 0,
        "pageClass": "",
        "childNameFormat": "",
        "pageLabelField": "name",
        "noGlobal": 0,
        "noMove": 0,
        "noTrash": 0,
        "noSettings": 0,
        "noChangeTemplate": 0,
        "noShortcut": 0,
        "noUnpublish": 0,
        "noLang": 0,
        "compile": 3,
        "nameContentTab": 0,
        "noCacheGetVars": "",
        "noCachePostVars": "",
        "useCacheForUsers": 0,
        "cacheExpire": 0,
        "cacheExpirePages": [

        ],
        "cacheExpireSelector": "",
        "label": "Some title",
        "tags": "",
        "titleNames": 0,
        "noPrependTemplateFile": 0,
        "noAppendTemplateFile": 0,
        "prependFile": "",
        "appendFile": "",
        "tabContent": "",
        "tabChildren": "",
        "nameLabel": "",
        "contentType": "",
        "errorAction": 0,
        "ns": "\\",
        "_exportMode": true,
        "fieldgroupFields": [
            "title",
            "other_field",
            "extra_field"
        ],
        "fieldgroupContexts": {
            "title": {
                "columnWidth": 20,
                "description": "Put some title here",
                "label": "Some title"
            }
        }
    }
}

Any ideas what might cause this issue?

  • Like 1
Link to comment
Share on other sites

I witnessed some rather strange behaviour some time ago (in another context), when using template (or field) names with -. I would avoid using the - chararacter altogether; use camelCase or _ instead.

Edited by dragan
wrong suspect...
Link to comment
Share on other sites

7 minutes ago, dragan said:

I witnessed some rather strange behaviour some time ago (in another context), when using template (or field) names with -. I would avoid using the - chararacter altogether; use camelCase or _ instead.

Thanks for the hint! I'm using template names with hyphens everywhere (and so does PW, for example 'basic-page') and didn't experience anything strange with that at all - so far. Are you sure the strange behaviour you saw was triggered by the hyphen?

Link to comment
Share on other sites

I'm sorry. I once (wrongly) assumed that there are certain "reserved" words (not hypens) like "title" or "page" that would cause problems in Lister Pro. Turned out, after clearing cache and session, everything was working as expected.

Link to comment
Share on other sites

On 23.10.2017 at 10:36 PM, Robin S said:

Just a hunch: maybe a browser extension is auto-filling those fields to blank. Do you experience the issue other browsers, or with all extensions disabled?

Good idea, but yes, I can reproduce the same issue with different browsers. It is definitely ProcessWire's behaviour.

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...