-
Posts
70 -
Joined
-
Last visited
Recent Profile Visitors
1,012 profile views
J_Szwarga's Achievements
Full Member (4/6)
16
Reputation
-
Please help! Error in production environment only!
J_Szwarga replied to J_Szwarga's topic in General Support
@bernhard OK you got me on a track here to finding this...thank you! I was able to get logged into backend (with notifications telling me about modules that are not available) and finally found if I could do "Refresh" on the modules menu, then all the site comes back to work again! So my question is....what does that Modules Refresh do? it refreshes the modules cache, but I'm wondering how I broke the modules cache to begin with?... If I restored a backup of the database but didn't include the "caches" table, then that could cause all my modules to be "disabled" I'm thinking? -
Spent hours on this yesterday and just a dead end. If you have any ideas here PLEASE help ? Here's the background: Running local on windows with MAMP PRO. Deploying to server pilot setup on ubuntu with atomic sftp deploys through git. Been using this setup on about 5 sites on daily basis for over 3 years and never ran into this yet. Don't know if this is related to my problem, but right before this issue came up, I tried adding an external library (postmark's official php sdk) with `composer require`. Not realizing that processwire already checks for the vendor/autoload.php and loads it automatically (in the root index.php), I added a line to require_once the vendor/autoload.php file. Worked fine on my local, but when I deployed to production, got an error about the autoload.php file not being found (incorrect path). So I removed the reference to autoload.php. Production environment still having issues with autoload. Hmm, "that's weird" i thought. I'm not requiring autoload anymore. Maybe one of the composer dependencies are? OK, let me revert all my changes back to BEFORE I added this composer stuff in, so at least I can get the site to run. Removed all the new dependencies in /vendor and also from composer.json. Commented out all my code that referenced these dependencies. Site still runs fine in development. Push to production....and now I get 'Fatal Error: Uncaught Error: Call to a member function addHookBefore() on null`. This is referencing a line in my ready.php that sets hooks on $forms: $forms->addHookBefore('FormBuilderProcessor::saveEntry', function ($e) {}) Why all of a sudden does my production environment see $forms as NULL in ready.php? But development works fine? I tried changing $forms to $wire->forms or wire('forms') or $this->wire->forms but all end up with same result. So I commented out all my code that set hooks on $forms, just to get my site to load. Once I do that...it does load. Almost. But now it gets to my page template and my menu has a reference to the MarkupSimpleNavigation module. $menu = $modules->get("MarkupSimpleNavigation"); And I'm adding a hook right after that: $menu->addHookAfter And I get the SAME ERROR: Fatal Error: Uncaught Error: Call to a member function addHookAfter() on null ????? My processwire production install is no longer recognizing any site modules???? But my development is. I tried recreating a brand new server, deployment from scratch, just to the git commit BEFORE things started breaking...and STILL $forms is NULL, and $menu is NULL. I totally deleted the /vendor folder and still nothing better. Please if you have any idea why processwire wouldn't be recognizing any modules let me know. THANK YOU
-
Hooks for modifying page->editUrl
J_Szwarga replied to J_Szwarga's topic in Module/Plugin Development
@bernhard thanks, yes I like your solution. Because then I can fallback to the built-in editUrl still in special cases when needed. -
ckeditor - Remove wrapping <p> from <img> in source code
J_Szwarga replied to CodeCoffeeCode's topic in Modules/Plugins
If you want to set this on a per-field basis, you can go to the Input tab for your Textarea field, and under Custom Config options you can put enterMode:2 -
Need for a InputfieldSubmit->disable() call?
J_Szwarga replied to J_Szwarga's topic in Module/Plugin Development
That is true, but they do require looking up the class name if you don't already know it. I noticed that InputfieldSubmit already has setSmall() (only 1 line of code) and setSecondary(). setDisabled() seemed like it would be consistent with these, just saying. -
Can't find any reference to a disable() method on the InputfieldSubmit field type...wondering if I should submit a PR to add this method as I'm just getting into using a bunch of inputfields on some process modules and have a need for this. The method would simply add the "disabled" attribute to the button, and add the class "ui-state-disabled", but having a nice disable() method to wrap that up would be something that everyone could use if it were built-in? I just hesitate to do a PR because I may be missing something, since surely if this was wanted it would have been put in by now??
-
Trying to find a hook or some other method to change the page->editUrl based on it's template? If this requires using custom classes, I don't mind doing that either. Just trying to find a way to redirect from the normal admin page editor to an editor i have custom made in a module for pages using specific template.
-
Get admin page used for module setup
J_Szwarga replied to J_Szwarga's topic in Module/Plugin Development
YES!! Thank you! -
I created a process module. From a hook in ready.php, I need to access the full http url for this process module's "page". <?php namespace ProcessWire; $info = [ 'title' => 'Sermon Requests', 'summary' => 'Dashboard for approving users to listen to the sermons archive', 'author' => 'Joel Szwarga', 'version' => 1, 'page' => [ 'name' => 'rolerequests', 'title' => 'Sermon Requests', ], ]; So I need to get the url for: http:mysite.com/admin/setup/rolerequests/ I need to retrieve this url while just having the name of the module class (In this case, UserRoleRequests) Because the page's name/url can change, I can't hardcode that part here. I've tried every form of wire()->urls() and modules()->get("UserRoleRequests")->propertyname. Thought this would be really simple but don't see it anywhere. Is there a $pages->get() selector that can let me use the process module classname as a way to find the admin page?
-
@Soma One of the pages at level 2 of my menu has template access restricted so it does NOT show up in lists/searches by default. The only place I DO need this page to show up is in the menu. Here's my MarkupSimpleNavigation options: $homepage = $pages->get("/"); $menuItems = $homepage->children(); bd($menuItems, "Menu items"); $menuOptions = array( // 'outer_tpl' => '<ul class="nav nav-pills" id="mainNav">||</ul>', 'selector' => "check_access=0", 'inner_tpl' => '<ul class="dropdown-menu">||</ul>', 'outer_tpl' => '||', 'has_children_class' => 'dropdown', 'current_class' => 'current', 'parent_class' => 'current', 'item_tpl' => '<a class="dropdown-item" href="{url}">{title}</a>', 'item_current_tpl' => '<a class="dropdown-item" href="{url}">{title}</a>', 'max_levels' => 2, ); I thought if I set 'selector' => "check_access=0" then the module would ignore security restrictions on any of the pages it finds for the menu. But adding this to the selector does not change anything -- the page using my secure template is still not being included in the menu (unless a user is logged in who has permissions to view that page). How can I get this page included into the menu for all users/guests?
-
$page->children("check_access=0") not working
J_Szwarga replied to J_Szwarga's topic in API & Templates
Of course I didn't see this until right after posting... Since I'm using MarkupSimpleNavigation module, the $menuItems that I'm passing to it are just for the root menu items...the MarkupSimpleNavigation module does the heavy lifting for getting the child items to build out the menus. The secure page that I'm trying to show is one of those child menu items. So this is not a problem with the selector...this is something that I need to sort out with MarkupSimpleNavigation. I'll rephrase this question in the MarkupSimpleNavigation support forum... -
I have a template setup with restricted access. I have the following option set on the Access tab: Before, I had this set to "Yes", and the page using this template was showing up in my main menu. I need to keep this page visible in the main menu for all users and visitors. But I need to set security on this page so that all of the children pages (which are based on many different templates) can inherit the security setting and NOT show up in searches/lists. So I changed this template to "NO", don't show up in lists. Now the page is not showing in the main menu (expected). So I thought, "no problem, I'll just tweak the selector used for my main menu items." $homepage = $pages->get("/"); $menuItems = $homepage->children("check_access=0"); So I simply add "check_access=0" to the children() method, so I should get ALL published pages, regardless of security. But...I still do not get the page using my secured template, unless I'm logged in with permissions to view the page. I try different selectors in that $homepage->children() call, and they work. Why is check_access=0 getting ignored?
-
I've attempted fresh install of the module, cleared the cache, etc. Any guesses on why I don't have any libraries to choose from? Thanks.
-
Here's my code for using the InputfieldFile in a form on a backend page (Process module) $f = $this->modules->get('InputfieldFile'); $f->name = "mp3_file"; $f->label = "Mp3 Audio File"; $f->extensions = "mp3"; $f->maxFiles = 1; $f->setMaxFilesize("200M"); $form->append($f); For "extensions" I've tried both ".mp3" and "mp3" without the period. The mp3 extension does show up in the form field UI.... But it does NOT limit which files are visible in the "open" dialog box to choose a file to upload... Furthermore, it does not limit which files can be opened and uploaded. Went through the source code and I'm still puzzled why this isn't working as expected. I would expect that the module would use the extensions to add an "accept" property to the input HTML element (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) But inspecting the html, there is no "accept" property on the resulting input element....and in the source code of InputfieldFile.module, a search for "accept" turns up 0 results.... Anyone have a clue for me?
-
J_Szwarga started following Use hooks to set page icons in admin menus and Page List
-
@d'Hinnisdaël I'm attempting to use the PageIcon module to show page icons on the front end through MarkupSimpleNavigation. Although it appears PageIcon is only for backend use. Do you know of a solution to this?