-
Posts
650 -
Joined
-
Last visited
-
Days Won
6
Everything posted by rick
-
Okay, I upgrade Tracy from 4.8.23 to 24. This is the result when executing bd($result); in the console: This is the result when I change pages from the admin menu:
-
When I execute a portion of code in the terminal and output the result using BD() it is placed in the Dumps (Ajax) panel, which is fine. However, there is no Clear Dumps option. If I change pages (another admin menu option) and return, all results are now listed in the Dumps Recorder panel, which does have the Clear Dumps option. The Dumps (Ajax) panel is then empty. Is there a way to add the Clear Dumps option to the Dumps Ajax panel?
-
I never really paid any attention to those access permissions before. Oh, the irony of being a tech writer and not RTFM! I'm just glad to have this toolbox available again. Kinda feel lost without it.
-
Hi @adrian, Sorry for the delayed reply. I set superuser force dev and the bar shows up correctly. Didn't tracy look at config->debug before? I don't recall having to set this option. No matter, it works now so all is good. Thanks!
-
Hi @adrian, I just created a subdomain (sep pw install) where I installed tracy, but the bar does not show up. In fact, it was running fine on the primary domain, but after installing it, neither site shows the debug bar. When I uninstall it still does not show up on the primary domain even though it is enabled there. Both sites are: pw 3.0.62 tracy 4.8.24 php 7.0 maria 10 Other modules (upgrade, profile export) all function on both sites. There are no errors in apache/pw logs. Any suggestions where I should look next?
-
Thank you.
-
Does anyone know how to set the disabled attribute of a button? I found nothing in inputfieldbutton/submit which allows this setting.
-
A user going directly to a page is either from a bookmark or typing (pasted) url. So you could check both the referrer and bookmarks on the desired target page(s). Otherwise you'd have to test and set a result (as @DaveP shows) on all non-target pages, then test for that result on all target pages.
-
So basically a stack trace of hooks and their parameters and results. Correct? Personally, I think this would be great, especially for those of us who have not dove into the hook pool yet.
-
When deleting a select options field (checkboxes multiple values) from the admin interface, the selectable option entries are not deleted from the fieldtype_options table. Is this a bug? PW 3.0.62 Note: I haven't marked this topic closed or solved because I want to keep all the questions and answers together.
- 3 replies
-
- checkboxes
- selectableoptionarray
-
(and 1 more)
Tagged with:
-
You are right. This is somewhat convoluted. However, I did manage to solve my problem using the information from the post you linked. I also remember now where that selectable options array error came from. With debug=true and advanced=true you normally hover over the collapse icon to view the field you use when defining your API fields. In this case the field shows as "_options". There is also a link to an article which describes the means by which you can manipulate this type of field. The article is incomplete, in that it does not describe checkboxes (multiple value). The selectable options error occurs when you try and use the article information with this type of field. The following is how you can create a multiple selection field via API utilizing checkboxes should anyone else come across this. if( !$f = $this->wire( 'fields' )->get( 'myOptionsField' ) ) { // check if field already exists $f = $this->wire( new Field ); $f->name = 'myOptionsField'; $f->label = __( 'My Options Field Label', __FILE__ ); $f->description = __( 'My Options Field Description.', __FILE__ ); $f->notes = __( "My Options Field Notes.\nCan be more than one line.", __FILE__ ); // We want this field to store our options $f->type = $this->wire( 'modules' )->get( "FieldtypeOptions" ); // You must save your field definition at this point, which is the same procedure through the admin interface. // You cannot modify other field parameters until the field is first saved. $f->save(); // assign a group tag to group like fields if you want. $f->tags = 'groupTag'; $f->required = 1; // required field = 1 // This is the same as selecting Checkboxes (Multiple values) on details tab. $f->inputfieldClass = 'InputfieldCheckboxes'; // Create a function (if needed) to retrieve your desired options from whatever source. $myOptions = $this->getMyOptions(); // return a sorted array of options // Set the number of columns based on the number of options. // Here I hardcoded 15 options as the break point for a new column. $f->optionColumns = ( count( $myOptions ) % 15 ) + 1; // Create a function (if needed) to convert your array of options to newline delimited string. $myOptions = $this->getOptionString( $myOptions ); // Fire up the option manager and add your option string to this field. $manager = new SelectableOptionManager(); $manager->setOptionsString( $f, $myOptions, false ); // Now you can save the modified field definition. $f->save(); } Now your process module can work with the available options. In your form process function, you will need the form ($f) and page ($p): private function processMyOptionsForm( $f, $p ) { $input = wire('input'); if ( !$input->post->submit ) { // Is form submitted return false; } $f->processInput( $input->post ); if ( $f->getErrors() ) { // Does form have errors $this->wire()->error( $f->getErrors() ); return false; } // turn off page formatting before changing values. $p->of(false); // remove any checkbox options previously selected. $p->myOptionsField->removeAll(); // loop through the page fields foreach( $p->fields as $fld ) { if( $fld->name == 'title' ) continue; // We don't want to change the page name // Is this our options field? if( $fld->name == 'myOptionsField' ) { // Here the array of user selected values is assigned to the selectable options of our field. $p->myOptionsField = $input->post('myOptionsField'); } else { // Set page fields to form field values $p->set( $fld->name, $input->post($fld->name) ); } } // Save the page with our new values $p->save(); } I hope this saves someone from a headache or three.
- 3 replies
-
- 2
-
-
- checkboxes
- selectableoptionarray
-
(and 1 more)
Tagged with:
-
Howdy all! In my process module I am creating a dynamic form which contains a variable number of checkboxes. The form displays correctly, and all but the selected checkboxes are saved. Tracy and the network show the array being passed in the post back to my process module. The target field was created as Select Options type, and the input is Checkboxes (Multiple values). I have tried the following without success: $p->of(false); $p->myOptionsField->removeAll(); // remove previous selected options foreach( $p->fields as $fld ) { // iterate page fields if( $fld->name == 'title' ) continue; // skip page title field if( $fld->name == 'myOptionsField' ) { bd( $input->post('myOptionsField') ); // Shows correct array of selected options $p->set( $fld->name, $input->post($fld->name) ); // No error produced //$p->myOptionsField = $input->post('myOptionsField'); // No error produced //$p->myOptionsField = $input->post($fld->name)->value; // Property of non object error } else { $p->set( $fld->name, $input->post($fld->name) ); // other fields are saved to database } } $p->save(); Note: I've also gotten an error about the sleepValue of the selectableOptionArray, but I don't remember what was wrong with the code to produce it. I left the tags in for this post to help others searching. Can someone please tell me how I should be doing this. I know it will be simple, as it always is, but my eyes are crossed.
- 3 replies
-
- checkboxes
- selectableoptionarray
-
(and 1 more)
Tagged with:
-
2 date fields, how to ensure the second date is higher?
rick replied to horst's topic in General Support
Sorry @bernhard, the forum won't let me like your reply more than once. I learned a couple of new things from your response. Kudos sir! -
Module refresh will show any changes you make to the info without having to re-install it.
-
When you navigate away from the page that uses your process, any changes should be reflected the next time you visit that page, unless you are modifying the module config fields. I have phpstorm open with my process module, and the module installed on localhost. When I make a change to the code, I simply select another menu option, such as pages, then re-select my process module menu and the changes are immediate.
-
My bad. I had snippets under modules. Since I don't want extra stuff in my templates folder I set it to use assets. Works fine now. Sorry for the oversight on my part.
-
Hi @adrian, I'm running 4.8.23 on localhost (pw 3.0.62) and I'm getting the following error when I enable the snippet runner: UnexpectedValueException: RecursiveDirectoryIterator::__construct(/xxx/site/templates/TracyDebugger/snippets/): failed to open dir: No such file or directory in /xxx/site/modules/TracyDebugger/panels/SnippetRunnerPanel.php:254 Permissions are 777 on snippets folder. Obviously I missed something, I just don't know what.
-
"Add new" menu item missing from Pages dropdown menu
rick replied to desbest's topic in Getting Started
3.0.62: The Add New button located on the far right at the top of the interface is for dealing with bookmarks, not pages. The Add Page in the screencast you post is for adding admin pages, not bookmarks. The New option displayed next to the Home entry in the page tree is for adding new pages, not bookmarks. I had the same question a while back. It's not very intuitive. edit. The Page submenu does display Add New to create a new page. -
There are also a few javascript based wizards you could use, such as jquery smart wizard, steps, form to wizard, etc. Depending on your needs, you can use processwire to create the appropriate data for whichever wizard, and then save and track the results.
-
@szabesz, Yes it appears to be the same issue still present in 84. What went wrong for me was that I attempted to install a module that depended upon another module which was not yet installed. I proceeded expecting it to install the dependency. No joy. So I did a fresh install because I don't trust any errors, regardless of how insignificant they may seem.
-
Just a suggestion for enhancement: There should be a means to prevent installation of components out of order. Yes, currently an alert is displayed. However, the user should not be able to proceed at this stage. We should have the module installation either install the dependency (as other modules state, "will install xxx") or have those modules not available until dependencies are installed. Just my $.02
-
[solved] Admin menu issues after ProcessModule install
rick replied to rick's topic in General Support
Good call. The menus now display their options correctly. -
Howdy all, I have a Process Module that installs without error. It makes the correct page under admin and the menu entry is also correctly displayed. All admin menu options function at this point. Using the default theme, when I click my ProcessModule menu entry, the execute function returns the proper data, but the admin menus no longer display their dropdown options -- I can only select from the top-level menu options. Once I select any other top-level menu option the menus function correctly. Using the uikit theme, when I click my ProcessModule menu entry, all options are removed from the header. That is, no logo, no menu options, no search. Nothing. The reno theme seems to function correctly, except maybe the icon associated with the module is not displayed in the menu. This is fresh 3.0.84 install, no hooks defined, and only Tracy and Upgrade modules installed. Has anyone else experienced this?
-
Nicely done @bernhard!
-
@diogo, Actually, my mouse stopped registering wheel scrolls a few weeks ago. On the positive side, I still have a middle button! Enabled the laptop pad and can scroll just fine with it. Wacom tablet doesn't scroll.