Jump to content

Macrura

PW-Moderators
  • Posts

    2,704
  • Joined

  • Last visited

  • Days Won

    38

Posts posted by Macrura

  1. @Pretobrazza,

    OK

    (1) so i just made a small modification which will convert the extension to all lowercase before it checks the field settings - each field has a list of allowed extensions; i'm guessing you don't have both jpg and JPG, so this will solve this hopefully.

    (2) Processwire expects an integer for image width, so if there is a % in the width, i guess the imagesizer is fatal error. I don't think it is technically correct to have anything other than an integer in the width attribute, but I have updated the module to skip resize for any images that have a percent in the width attribute.

    (3) You can run a simple script in Tracy Debugger;

    $p = $pages->get([page id]);
    foreach($p->children as $c) {
        $c->of(false);
        $c->save();
    }

    @Pete - sorry for not replying to your post, i wasn't following this topic for some reason, so i didn't see your post. I'll look into the multilanguage thing, so that it scans all of the languages. I'm. guessing that right now it doesn't work at all for importing images in a multilanguage RTE field.

    • Thanks 1
  2. The module has been updated and now loads the prev/next links via ajax, which should hopefully solve any issues with the module potentially slowing down the page editor load.

    The work of finding the prev/next pages is handled by an ajax request after the editor is loaded. Been tested on all 3 admin themes, with link locations in breadcrumbs and in tabs.

    • Like 1
  3. 8 hours ago, d'Hinnisdaël said:

    My two cents on this: I feel like it's the other way around — $config as a data store is (for the most part) internal to ProcessWire's backend. The $config->scripts and $config->styles arrays are wired up in a way that makes sense for the admin panel to work properly. Using them for the frontend is surely convenient (I've done that myself on a lot of sites) but probably not meant to be used that way and prone to breaking. I've personally stopped using the internal file arrays for that reason and created namespaced versions for the frontend.

    In one sense that could be an interpretation, but another interpretation is that it can be used on the front end, and i know of some other devs that do use it on live sites so i think it's still risky to autoload scripts or styles on a module without just loading the assets where you need them..

    Quote

    Array used by ProcessWire admin to keep track of what javascript files its template should load. It will be blank otherwise. Feel free to use it for the same purpose in your own sites.

    I don't currently know any modules where the $config->styles/scripts load on the front end inadvertently, but i'll keep a lookout. I have a module that loads into those for the purposes of use on the front end (Soundmanager).

    The idea is to create an ecosystem where markup generating modules can have a way to load dependencies on the front end - in Soundmanager2, you need to load the various files based on your settings. By checking to see if there is anything in $config-styles/scripts, i can have modules that can load dependencies using the core $config class.

    Maybe there is a better way, but $config is a useful class and i'm using it all over the place for front end development..

  4. @kixe

    So the issue here is that the module has a JS file named the same as the module - this is a problem because this module is autoload, and as such the module's JS file is polluting the front end output for any of us who use $config->scripts, meaning that our scripts for use on the front end inadvertently includes the module's js file, which is not only unnecessary, but also is breaking my frontend api.

    a much better way of loading the JS file is to rename it and then just load the JS on the module's setting page, you can do that by checking the input and loading your js.

    For now i just disabled the js file, i don't even know if it is needed, or being used, and this has fixed the problem.

    • Like 1
  5. @Sevarf2 - just updated the code to ensure that both the settings array and the key within the array exist. (This would prevent inadvertently adding a settings array or setting if the key is typed incorrectly), if they don't it will ignore the changeSetting() call.

    • Like 1
  6. @Sevarf2 If you want to test this, you can add the following code to the module at the end of "SettingsFactory.module".

    	/**
    	 * @var $key - the settings key
    	 * @var $_key - the setting within the key
    	 * @var $value - the new value
    	 */
    	public function changeSetting($key,$_key,$value) {
    		$modData = $this->modules->getConfig('SettingsFactory');
    		if(!array_key_exists($key, $modData)) return;
    		if(!array_key_exists($_key, $modData[$key])) return;
    		$modData[$key][$_key] = $value;
    		$this->modules->saveModuleConfigData('SettingsFactory', $modData);
    	}

    and then this would be the way to change the setting from api:

    $factory->changeSetting('wiretabs-testing1','settings_client','new value');

    in limited testing this has worked fine, but i'd recommend a few more tests before using on production. I haven't commited this to the master yet - it probably needs to include a check to ensure the target key exists in this case.

    This also illustrates that it would be possible to add settings (addSetting), but since the fieldset is defined in a hard file, any settings added in the api would not be editable in the admin, so not sure if that would be useful.

    • Like 1
  7. you could try replacing line 263, which is this:

    $itemsList = explode(PHP_EOL,$that->itemsList);

    with this:

    $itemsList = preg_split('/\n|\r\n?/', $that->itemsList);

    let me know if that fixes it; if so then i can test on non-windows and then make the change to the module...

  8. ok thanks - i think it can be done no problem, but i think the api should be cleaner where you don't need to deal with setting array values; i'll have to post back once i have a working prototype.

     

    • Like 2
  9. @Sevarf2 - I was able to successfully do that by adding a custom setConfigDataCustom method to the module, but this would be a beta feature until it is tested further. I'm not totally sure if i'm doing it the best/right way, so this was just a quick test, but it did work.

    However the api is not so intuitive for this currently as you first need to get the settings array for the key, then alter the value of one of the items, or add a new item (not tested) and then write the whole array back to the module

    $factory = $modules->get("SettingsFactory");
    $mySettings = $factory->getSettings('wiretabs-testing1',false); // return array not wiredata
    $mySettings['settings_client'] = 'Jimmy James 4th';
    $factory->setConfigDataCustom('wiretabs-testing1',$mySettings);

    I think it might also be possible to write settings to the module that don't have process pages, using this, but not sure how useful that is, i assume that it will be possible since the settings are just module config, so you'd be able to store anything you'd want in those arrays...

    If you can elaborate on the use case for this that might help to determine the best way to implement it.

    • Like 1
  10. Sorry if this has already been asked, there is a "View site" menu item, say when using AdminThemeUiKit, and i want that to open in a new tab, however checking off the "Open Home/View site in new tab (topnav)" seems to have no effect.

    1980983969_Module__AdminOnSteroids__aaroncopland_com_-_Mozilla_Firefox.jpg.efef00c30e46acdcb0e747e39e7fa641.jpg

  11. I have been able to track down the issue, the cause of the crash was my own module – TextInputAwesomeplete which was not compatible with the new custom fields on images feature. I have pushed a fix, but i wonder about the core, in terms of it being able to be resilient against a pagefinder query that incorporates one of the 'virtual' fields.

    https://github.com/processwire/processwire-issues/issues/1104

    • Like 1
  12. 2 minutes ago, dragan said:

    Perhaps you have to only replace _ with - in your template name. From what I gathered, it should be a - character, not _.

    thanks - no, the template itself is named correctly, field-images; else the system wouldn't pick it up as a files field definition template... The output field naming (what is being generated in the edit form) is handled by the system..

  13. 54 minutes ago, dragan said:

    Are you doing a search of some sort? i.e. using a selector? A field name like author_images_randomgibberishstring sure looks strange. Did you name it like that?

    No search,

    no selector;

    No - the system makes up field names like that which comprise the custom field, the image field, and the id of the asset. [custom_field]_[file/images_field]_fileID. You can inspect any files or images field where you have custom fields and you'll see the same thing.

    54 minutes ago, dragan said:

    Maybe you are using an image field inside repeaters?

    No, no repeaters.

  14. @MarkE -

    The events just have a page field multiple where you select the works being performed. Some events come in through Boosey and those have a reference ID we store so those are auto assigned.

    Works pages just have a section that searches for upcoming events and outputs them. But there are a ton of other ways that works are connected to each other, using versions, members and custom taxonomies that focus the relationships that are specified...

    • Like 3
  15. On one of the sites, the host put this in, so if you figure out the ID of which rule is being triggered, you would add this, in addition to the more general snippet.

    <LocationMatch "/">
            SecRuleRemoveById 77218500
    </LocationMatch>

    If you have access to the Formbuilder forum, there are around 4-5 posts about this similar issue with various examples of htaccess rules, remove by ID etc.

  16. I have a hosting account that runs litespeed, and i use this snippet in the .htaccess, which was recommended by Ryan.

    <IfModule security2_module>
        # Allow ModSec rule processsing without disruptive action
        SecRuleEngine DetectionOnly
        SecFilterEngine Off
        SecFilterScanPOST Off
    </IfModule>

     

     

    • Like 1
  17. In an ongoing effort to provide a sort of case study, and more info about this, I'll post random screens and info about the various features of this site.

    (1) Custom Dashboards

    The site uses a custom module that supports multiple dashboards. Any given dashboard is configurable and access controlled also. This is the main dashboard:

    36540512_Dashboard__ProcessWire__aaroncopland_com_-_Mozilla_Firefox.thumb.jpg.571cf97b6e141411510954717478d094.jpg

     

    (2) The admin editor pages take advantage of some great modules, namely RuntimeMarkup @kongondo, PageFieldInfo @Robin S, Field Descriptions Extended and more, There is also a new module not released yet called Admin Comments, which for this project got a lot of use.

    179791582_Screenshot_2020-02-15_Edit_Page_Appalachian_Spring__suite_for_thirteen_instruments___aaroncopland_com.thumb.jpg.1d42bc0abd933b5535178821c0bad3a6.jpg

    When dealing with a large and complex data collection as was the case with this project, the editors benefited from the ability to have the data auto-analyzed on each work so the "auto flags" field helped with that. The comments also allowed editors to post information, ideas and comments right into the page editor. The AdminComments module also provides the option for any posted comment to be emailed to the other team members (selectable), and the notification email (which is customizable) allows the recipient to click directly to the editor for that page. This saved incalculable hours of work, and enhanced communication during the project, across this large data set.

     

    • Like 17
    • Thanks 1
×
×
  • Create New...