-
Posts
2,776 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
Yes - thanks, i'm using the color on an admin dashboard, which is being wireRendered from a module, so i assume that output formatting is off; Is there any way to get the formatted output in this situation?
-
I'm having the problem that i always get the 2nd option output (8 digit hex color, and no hash), no matter what i select for the Output Format. Right now i'm doing an ltrim($widget->color, 'ff'); on the output, and then adding the hash myself, but would be good to get this fixed... TIA
-
looks like the process is returning a 403... maybe a file permissions issue, or host is blocking something, maybe mod security... check these topics:
-
try repairing the database, also this may be related (?)
-
[SOLVED] Extremely slow to open / save one template type in admin
Macrura replied to prestoav's topic in General Support
wow for one i can say that is a lot of repeaters, each with a lot of fields. You probably need to ajax load the repeaters and repeater matrix fields to start, or put them all on a tab and ajax load that whole tab. with up to 10 entries on a repeater holding text, image, textarea (is this RTE?), and page ref (how many pages, and what inputfield are you using?), i would probably have gone with page table instead, though it might work. Also, assuming your MySQL instance is localhost? i have sometime seen some slowdowns when using MySQL hostnames, due to the additional DNS lookups; Have you tried optimizing and repairing all of the tables? also you may want to experiment with auto join for some fields here, but be careful, sometimes autojoin can cause problems... -
[SOLVED] Header field displays content strangely
Macrura replied to joeck's topic in General Support
Did you mean this? <h1> <?=page->header . ' | ' . $page->title?> </h1> -
ok great, i'm hoping to test the changes and push the update to the module next week..
-
the way this module works is that the json is attached to each option; you could use a plain selectize init on your inputfield select, i do that a lot and it works well... using something like a hook in ready or admin custom files...
-
To answer the first question, can you try the attached module and let me know if it works; You need to use the new method addBlankOption(); which will then add the correct data-data attribute to the option in case you want to use something like 'Please Select...'; $f->addBlankOption(); or $f->addBlankOption('Please Select...'); This is really only necessary when using from the API because in page edit context i think the default behavior works; this does allow you to use this inputfield in modules which is cool, and have a blank option; needs more work though since the blank option json in data-data attribute will need to match the other options.. might be some time till that part is solved, but this should work for now.. InputfieldSelectize.module
-
ok thanks - will look into it asap - it is because the module is using the addOption() method which is filtering out the items with no value, guess this needs to be fixed... Edit : testing here and it seems to be working correctly - i'm not seeing the empty option filtering out - can you tell me more about the settings on the inputfield is it set to single (not multiple pages?)
-
Hi Sipho - ok i'm not sure how the required works for single input, when you look at the source, is the source code showing the first option selected (the pw source <select> element? If that's the case then the required behavior of the field is inheriting from PW, i don't think the JS can affect that..
-
speaking of download icons – there is a (probably not used much, but nonetheless awesome) module called Secure File - for that module, the download button doesn't work, i guess AOS is not compatible with that module; I disabled the "Add Asset Download Button", since that module already provides a download link for the file. Just wanted to post that here in case someone else uses secure file and comes across the non-working download (if they have AOS add asset download enabled)...
-
Sister site: Style Guide, or Atomic Style Guide / Pattern Library
Macrura replied to BrendonKoz's topic in Dev Talk
The way i see Gantry is like a really developed 'frontend api', which seems to use an mvc-ish model; I use a frontend api based on the wireRender pattern which is in some way similar to the Gantry setup. In PW, it could be done, you'd end up with several interconnected modules that simplify frontend needs, like global settings, managing per-page assets, injecting stuff (js, schema, meta etc) into the head.. There are already some frontend api modules now like Spex; For just having a styles guide page, that would be easy, you could just have a pure html page showing all of the demo stylings, sections, shortcodes and whatever; or have a hardcoded demo site on a subdomain for the clients to reference. -
Repair/Optimize Database, Tables Crashing
Macrura replied to Macrura's topic in Module/Plugin Development
@adrian - ok thanks, that's good to know; Not sure what could be the cause of this, it happened on some 2.7.3 sites, as well as some 3.x sites. Overall Site5 has been good in terms of speed, uptime and reliability; i submitted a support ticket regarding this issue but never really got any answer as to why it could happen... This is the error that happens to the editors when they save, if the table crashes.. SQLSTATE[HY000]: General error: 145 Table './database_name/field_body' is marked as crashed and should be repaired (in /wire/core/WireDatabasePDO.php line 454) -
I encountered a situation over the past few months where tables have been crashing when a user saves a page in PW. I'm assuming it is something related to the server/hosting provider (Site5), because it only happens on this host, but across completely different unrelated accounts. When it happens the table in question gets "marked as crashed", and then shows "in use" when you see the table in PHPMyAdmin. No data is retrievable by PW from whichever table/field is crashed, so if the body table crashes, then the front end doesn't show any body text anymore until someone goes into PHPMyAdmin and repairs the table. I'm trying to make a module or at least some button the client can click from their admin that will run a repair on the tables so i don't have to help them and go to their cPanel etc.. I added a button on the dashboard of the sites in question (for sites that i use a dashboard on), or i told them to bookmark the link to the repair process, something like example.com/repair_database.php?action=repair; so far it seems to work but wanted to check to see if anyone sees any problems or improvements to this, it was done in only a few minutes, so may have left out something... I'm not sure if this could/should be made into a module, since it is conceivable that a table could crash that would render the modules system non functional, so thought maybe better to be a bootstrapped script(?) <?php // in root of pw installation - this is the 3.0+ version; repair_database.php /* Bootstrap PW ----------------------------------------- */ include("/home/path/to/index.php"); $config = \ProcessWire\wire('config'); $user = \ProcessWire\wire('user'); if(!$user->isLoggedin()) die("access denied"); function optimizeTables() { $tables = array(); $db = \ProcessWire\wire('db'); $result = $db->query("SHOW TABLES"); while ($row = $result->fetch_assoc()) { $tables[] = array_shift($row); } foreach ($tables as $table) { $result = $db->query("OPTIMIZE TABLE `$table`"); while ($row = $result->fetch_assoc()) { echo $row['Table'] . ': ' . $row['Msg_text'] . "<br /> \n"; } } } function repairTables() { $tables = array(); $db = \ProcessWire\wire('db'); $result = $db->query("SHOW TABLES"); while ($row = $result->fetch_assoc()) { $tables[] = array_shift($row); } foreach ($tables as $table) { $result = $db->query("REPAIR TABLE `$table`"); while ($row = $result->fetch_assoc()) { echo $row['Table'] . ': ' . $row['Msg_text'] . "<br /> \n"; } } } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Database Repair & Optimize Tool</title> </head> <body> <pre> ____ _ ____ __ __ / __ \___ ____ ____ _(_)____ / __ \____ _/ /_____ _/ /_ ____ _________ / /_/ / _ \/ __ \/ __ `/ / ___/ / / / / __ `/ __/ __ `/ __ \/ __ `/ ___/ _ \ / _, _/ __/ /_/ / /_/ / / / / /_/ / /_/ / /_/ /_/ / /_/ / /_/ (__ ) __/ /_/ |_|\___/ .___/\__,_/_/_/ /_____/\__,_/\__/\__,_/_.___/\__,_/____/\___/ /_/ </pre> <?php if($input->action == 'repair') { repairTables(); } if($input->action == 'optimize') { optimizeTables(); } ?> </body> </html> example button:
-
Module Visual Page Selector (commercial page picker module for ProcessWire)
Macrura replied to kongondo's topic in Modules/Plugins
you. are. awesome. -
Modify "Custom Page Label Format" via hook/API
Macrura replied to Jonathan Lahijani's topic in API & Templates
Also consider InputfieldSelectizeMultiple, it can support any complex markup for the select items, and any field, subfield, sub-subfield etc.. -
sorry, my first reply was a mistake, thought i edited it, but instead added a 2nd reply - the first reply only fixes the z-index issue; in terms of why the tags all vanish, it must be something with the JS init; for any sites in production, i have now switched over to use the module, and it works fine, and fixes both the vanishing tags and the z-index; depending on how you use image tagging you should be able to seamlessly switch between core tagging and module tagging, as long as you don't use the label/value pairs that the module features. At this stage the differences can be summed up: | Feature | Core | Module | |---------------------------|------|--------| | Label/Value Pairs Support | N | Y | | Z-index problem | Y | N | | Template context support | N | Y | | Tags vanish on upload | Y | N |
-
that's actually inside the comment header, in case i need to put it back
-
I think this has to do with how the core inits the field on reloaded, the module does it differently (thanks to @Robin S) and the tags remain in place.
-
@matjazp you can add those to your AdminCustomFiles, or use the SelectizeImageTags module which has the fix built in; not sure what other ramifications of these CSS overrides are, but so far they work and i haven't seen any issues, but they do override core CSS styling on the image field.
-
looks like the modules directory isn't parsing or understanding the info file: "requires_versions":{"":[">=",0]} http://modules.processwire.com/export-json/SelectizeImageTags/?apikey=pw300 i probably need change something in that <modulename>info.php, since the $config check needs to check the target site, not the modules website, in case the engine that creates that json page is PW..
-
it definitely works overall (when the module is already in the modules dir), but can't figure out why it fails on the upgrades download, the requires numbers look messed up...
-
ok thanks - yeah i moved the module info into the <modulename>.info.php field and in there i add the module requires to the array by checking the config->version; maybe there is something wrong with how i'm doing that... $info = array( 'title' => 'Selectize Image Tags', 'author' => 'Macrura', 'version' => 007, 'summary' => 'Admin helper for enabling selectize.js on images tags field.', 'href' => '', 'icon' => 'tags', 'singular' => true, 'autoload' => 'template=admin', 'requires' => array( 'ProcessWire>=3.0.61' ) ); if($this->wire('config')->version < '3.0.67') { $info['requires'][] = "JquerySelectize"; } *Btw - i do have that module (JquerySelectize) also installed anyway, in case that matters..
-
@Robin S i'm having some trouble with the upgrade on this, not sure what's going on, maybe related to the upgrade method? this is on 3.0.70, so it should meet the requirements... i'll try removing the upgrade function and see if the mod requirement works