Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
Bureaucracy - "Could not read template..."
Avatar
JWC #1
Member for 3 months · 6 posts · Location: London, UK
Group memberships: Members
Show profile · Link to this post
Subject: Bureaucracy - "Could not read template..."
Hi Forum,

Having got nothing but the error message in my initial namespace and form and template I reverted to the documentation examples in playground to try and identify my error. Despite copying exactly the examples in the documentation I still get the "Could not read template..." error message whenever I submit a Bureaucracy form to a template.

My action line is: action   template testtemplate playground: _

My form is: playground:entryform

My template is: playground:testtemplate

I am logged in as an adminstrartor so have read/write permissions for all namespaces.

I have seen other posts on this topic but no solution that doesn't involve steps that do not seem they should be necessary from the plugin documentation.

What might I be doing wrong?

Many thanks for any suggestions,
Best wishes,
Jonathan
Avatar
pop #2
Member since Nov 2016 · 179 posts
Group memberships: Members
Show profile · Link to this post
What's the content of the fields that are used in forming the name of the new page?
Avatar
JWC #3
Member for 3 months · 6 posts · Location: London, UK
Group memberships: Members
Show profile · Link to this post
Hi Pop,

the form from the Bureaucracy documentation I am using is :

<form>
action   template testtemplate playground: _

fieldset "Create Your User Page"
select   "What's your Continent?" "Europe|N. America|S. America|Asia|Australia|Africa" @
textbox  "What's your Name?" @
textarea "Enter a short bio" !
submit
</form>

which I am testing with for instance JWC in "What's your Name?" and Europe in "What's your Continent?" which are the two elements selected by @ to construct the page name, if I've got that right? I would expect page playground:Europe_JWC or playground:europe_jwc  to be created?

The template is:

====== @@What's your Name?@@ ======

I'm living in @@What's your Continent?@@. I'm a user since %Y-%m-%d.

@@Enter a short bio|FIXME please fill in your biography@@

Many thanks,

Jonathan
This post was edited on 2019-07-04, 10:02 by andi.
Avatar
andi (Administrator) #4
User title: splitbrain
Member since May 2006 · 3474 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Your example works fine for me. Are you sure you have a page called testtemplate in the root namespace that contains your template syntax?

I would expect page playground:Europe_JWC or playground:europe_jwc  to be created?

Yeah. Works exactly like that for me here.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
JWC #5
Member for 3 months · 6 posts · Location: London, UK
Group memberships: Members
Show profile · Link to this post
Hi Andi,

thanks for taking a look.

Are you sure you have a page called testtemplate in the root namespace

Yes, as sure as anyone can be. I have checked and checked.

I wonder if I am mis-understanding where the template should be or how I should be referencing it in the action line.

I have tried having the template in the playground namespace and then what I understand to be the root namespace (i.e. no namespace = the pages folder on the server), and I have tried the following in the action line as the template address: playground:testtemplate , :playground:testtemplate, testtemplate and :testtemplate.

The first three bring error
Could not read template "playground:testtemplate".
and the fourth brings error
Could not read template "testtemplate".
which appears to me as though it is looking in the right place.

The template is definitely called testtemplate. I have checked and checked and cut and pasted to ensure no typos.  It is a .txt file on the server in the  namespace folder corresponding to the namespace address in the wiki. Should it have an underscore like other templates? I thought from the documentation not? Should it be some other file type?

I really have tried every configuration of template position and action line address that I can think of, many more than I have described above.

I have also tried all this in different parts of the wiki. It is not a public wiki, we are using it as an internal knowledge base for three different projects. The permissions across the wiki are really simple. Admin (me), user (about 30 people all with the same edit rights) and read (everyone else). I have tried the form logged in as a user and as admin, but nothing changes that relentless error message.

Is there anything else I can check?


Best wishes,

Jonathan
Avatar
andi (Administrator) #6
User title: splitbrain
Member since May 2006 · 3474 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by JWC:
Should it have an underscore like other templates?

No, the template here is a normal page that you can create through the wiki. No need to do anything directly on the server. I don't know how to help you further as it works for me as expected with exactly your settings.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
JWC #7
Member for 3 months · 6 posts · Location: London, UK
Group memberships: Members
Show profile · Link to this post
Subject: {closed unresolved}
Hi Andi,

thanks for confirming.

Incredibly frustrating as you can imagine and a bit weird. I have spent hours and hours on this now. Should a note be put on the documentation warning that this might happen and to test first before committing to it as a plugin?

I guess this thread in the forum will be warning enough.

Cheers,

:Jonathan
Avatar
pop #8
Member since Nov 2016 · 179 posts
Group memberships: Members
Show profile · Link to this post
I just tried to reconstruct the problem, but could not do so.

First, I create the entry form by typing "playground:entry" into the search field and opening the new page in DW.
Second, create the template by typing "playground:testtemplate" into the search field and opening the new page in DW.

Using the new entry form immediately works.

Of course, I can produce the error message "Could not read template "playground:testtemplate". Maybe it doesn't exist or you have no read permissions?" by changing the name of the file "testtemplate.txt" into "Testtemplate.txt" or "testtemplate" or something like that. I presume that you also could make the file unreadable by adding somes strange control characters, but I found no fast way to do that.

The attachment shows the listing of the directory holding both the entry form and the template as well as a page produced by the Bureaucracy plugin.
The author has attached one file to this post:
Bildschirmfoto vom 2019-07-08 00-40-32.jpg 13.8 kBytes
You have no permission to open this file.
Avatar
JWC #9
Member for 3 months · 6 posts · Location: London, UK
Group memberships: Members
Show profile · Link to this post
Hi Pop,

thanks for taking a look.

I have done the exact same as you describe, cutting and pasting the page names, no free typing. Still the same error message.

I can see and edit both pages, and search finds them, and I can  create pages in the namespace, so I think that rules out 'no read permissions', and the template page definitely exists in the location described with that page name. So that means that the error must be something other than what the error message is flagging, surely?

What else might be wrong? It's pretty frustrating as I'm sure you can imagine and having spent the amount of time that I have on it, I am going to say please don't waste any more time on it yourself on my account, as I won't be. It was so I could use Calendoku that I wanted to get Bureaucracy working, but I have just gone for a Google calendar now. Its not ideal, but it will do.

I hope this thread just serves as a warning to others that there is a setting in the wider wiki or a requirement or something in Bureaucracy that isn't documented and the template function might not work for them too, for no apparent reason.

Other than this I think DokuWiki is brilliant. Having also created sites with TikiWiki (ghastly), MediaWiki and WordPress, it is by far my favourite.


Best wishes,

Jonathan
Avatar
hj #10
Member since Apr 2008 · 173 posts · Location: Lancaster, UK
Group memberships: Members
Show profile · Link to this post
Hi Jonathan,

Not sure if you resolved your problem or moved on with a different solution.  But I've had exactly the same issue with the dreaded "Could not read template" error message.  I too have been scratching my head and checking and double-checking file locations, file names, file permissions....and all seemed good; but still the message and still couldn't submit my forms.

However, I think I may have solved it - well, my issue, at least.  It seems I didn't have sufficient permissions granted to users via the Access Control List (ACL). 

In my situation, the form is contained in a standard dokuwiki page, but on submission of the form dokuwiki has to WRITE to the template which displays the output.  In my case, this template is held in a namespace, like tripreports:surface_trips and the template file is named surface_trips.txt

While the files themselves had full read/write permissions (i.e. on the Windows operating system), the users of the ACL list didn't have full permissions.  I changed the ACL permissions for the directory/namespace tripreports to 'upload', which is the max available without letting people delete entries (which I wanted to retain as an admin only privilege).

My form submissions are now being successful without any error messages.  Hope this helps.

Hugh
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-09-23, 15:38:34 (UTC +02:00)