-
Posts
11,205 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
Users to have access to specific pages (not templates)
adrian replied to a-ok's topic in General Support
No need to remove "view" rights, just do a check at the top of your template file (or in an included file if you need this across your site) which checks the user and determines if they should be able to view the page. If not, then you could redirect them elsewhere. Does that make sense? -
I don't really understand still - surely if the PDF script is generating errors that Tracy is reporting, you'd want to know, but maybe there is some weird interaction that is causing problems when there really isn't any. As for providing a way to switch off for some scripts, I just had a try at implementing something, but I don't think it's going to be possible because Tracy is loaded before anything else so that it can catch all errors, but this means that any variable you try to set from a script won't be available when it's time to enable Tracy or not. Does that make sense?
-
@Roych - are you talking about this module: If so, please see the second post where the problem is explained and a fix provided.
-
@MilenKo - if you want and it's online somewhere, I can take a look if you PM me login details.
-
Well in that case, the error is because you didn't put a semi-colon at the end of your bd call
-
The console is awesome, but it won't have access to $input->post->cite because you haven't submitted the form to the console. That said, I also don't know why you are getting a 500 error. If I run that bd call in the console it just returns null as you would expect because it isn't set. Anymore details on that 500 error? Do other bd calls in the console work ok, eg: bd('test');
-
I just added: bd($input->post->cite); to the: if ($input->post->submit) { block and it output the name correctly. Where are you putting it? Did you check the browser dev console for info on the 500 error?
-
I just tested the code you posted last and it works perfectly for me, so not sure what it going on at your end. If you are new to Tracy, have a quick read of the docs: https://processwire.com/blog/posts/introducing-tracy-debugger/#bardump
-
Did you clarify that the hidden cite form field is being populated with the correct value from $user->name ? In the DB for the comments field, you mention that the cite field getting populated with "admin" - if that is happening, then it's got to be due to the form population or processing and adding of the comment via the API. Do a test debug of the value of $input->post->cite in your code to make sure it is showing "test" and not "admin". Tracy Debugger's bd($input->post->cite) would be the easiest approach to this.
-
I'd love to know which module was causing the problem
-
Ok, but when looking at the comment form, is $user->name correctly populating the username of the currently logged in user? What about when you are processing the submission form - are you still using: $c = new Comment(); $c->name = $sanitizer->name($input->post['name']); or did you change this to the correct: $c->cite = $input->post->name('cite'); Note that I am using the $input sanitizer, but the key thing is that I am making use of the POSTed 'cite' field.
-
How are you posting as a different user? Are you logged in as a different user, or just entering a different name and email address? How are you retrieving the author - via "cite", or "created_user_id"?
-
Hey @bernhard - sorry I am not following exactly what happened when generating the PDF - can you please provide more details/code as I would like to investigate that further. As for turning Tracy off - there is a "Disable Tracy" button on the Panel selector. There is also a dedicated "Tracy Toggler" panel/button. With either of these options, Tracy won't be loaded until it is enabled again, via a single icon that is positioned instead of the full Tracy debug bar. Is this what you are looking for, or are you wanting some other way to disable? I am still wondering if perhaps your PDF generating problem is indicative of a bug in Tracy that needs fixing. Is it an AJAX call? Code examples would be helpful please.
-
Github Pull Request - I linked to it above, but here it is again: https://github.com/ryancramerdesign/ProcessWire/pull/954 That really depends on how many comments the site is likely to get and how much time there is for moderation But then again, if there is no approval process for registration, it doesn't prevent spam comments anyway.
-
Here is the post with the Lister Mode screenshots: https://processwire.com/talk/topic/6102-batch-child-editor/?do=findComment&comment=100763 You can set it up to edit any/all fields using the Lister interface. The only problem is that it doesn't allow for adding new items/child pages. Maybe what we actually need is to modify the repeater field to allow it to store pages under a specified parent within the page tree, rather than under Admin > Repeaters
-
You're setting the "name", but there isn't a "name" field, it's the "cite" field that you need to populate the new comment with. Maybe you could take a look at my old PR and update it for PW 3 and re-submit because it takes care of this without manually building/processing the comment submission form.
-
Is this what you are referring to: http://processwire.com/api/ref/fieldgroups/ Not sure why it isn't linked - must be missing from the API Explorer script that @ryan runs to generate the ref pages. There actually seems to be the opposite problem with: http://processwire.com/api/ref/wire-database-backup/ - that page 404s, but is linked to under Core Classes > WireDatabaseBackup in the dropdown.
-
Again - using @fbg13's code is not pulling the value from the cite field, but rather from the details of the currently logged in user. If you require that a user is logged in before commenting, that will be fine, but if not, it will always return the guest user, so you would need to figure out the issue with cite. Let us know what you find regarding the cite DB column/field. As for why it might not be being populated, are you using $page->comments->renderForm() to generate the comment form, or are you creating it manually? Is it asking for "Your Name" along with email address and the actual comment The "Your Name" field is what populated the "cite" field in the db.
-
Remember that the "cite" field is not storing the same info as the "created_users_id". In most cases, "created_users_id" will be "40" - the ID of the guest user. "cite" can be entered manually. Have you checked the "cite" field in the DB table for the comment field? Is it actually being populated? May or may not be useful, but if your users are always logged in, check out this very old PR: https://github.com/ryancramerdesign/ProcessWire/pull/954
-
Just an FYI - I have that setting on (as is default), and if I link to a page without the trailing slash, it always redirects to the slash version. Any chance you have something that might be hijacking the redirect?
-
@Sipho - You can choose different templates for Repeater Matrix fields - that link I provided shows examples and states: But, as with repeaters, they are not pages with URLs that can be directly visited - you could probably "fake" this by using URL segments on the parent page and use the passed values to determine which repeater item to show. OT - I completely agree that the PageTable interface is not ideal - seems to me we need the repeater matrix editing interface for PageTable fields as well. When the PageTable field was added, repeaters didn't support ajax loading, hence the modal editing interface to ensure it was scalable with lots of items.
-
Not free, but check out Repeater Matrix: https://processwire.com/api/modules/profields/repeater-matrix/
-
How to add repeater items to repeater inside repeater matrix
adrian replied to Raymond Geerts's topic in API & Templates
Take a look at this: https://github.com/adrianbj/ProcessAdminActions/blob/master/actions/PageTableToRepeaterMatrix.action.php It's purpose is to convert a PageTable to RepeaterMatrix, but you should find the code snippet in there that you need. -
Another option is the functions API: https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-functions-api which lets you do things like: pages("template=basic-page")
-
Why are my pages only accessable in default language?
adrian replied to Timo's topic in Multi-Language Support
This will happen automatically if the fields for the page don't have a translated version - they will fallback to the default language. Also, just an FYI - you can also use Admin Actions to batch activate languages.