Jump to content

bluellyr

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by bluellyr

  1. Hi, I using the Processwire 3.0.231 and PHP 8.3 and I am seeing some PHP Deprecated warnings on the Tracy Debugger related to the AdminOnSteroids module. This is also happening on the PHP 8.2. These are the are the PHP Deprecated: - The lines might be a little bit off because some of the warnings only showed after fixing the first ones. #1: PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in .../site/modules/AdminOnSteroids/AdminOnSteroids.module:1572 #2: PHP Deprecated: Function utf8_encode() is deprecated in .../site/modules/AdminOnSteroids/AdminOnSteroids.module:1779 #3: PHP Deprecated: Function utf8_decode() is deprecated in .../site/modules/AdminOnSteroids/AdminOnSteroids.module:1797 And these are the fixes that I have patched/fixed on the AdminOnSteroids.module: For the #1: - Original code: $inputfieldClass = str_replace('Inputfield', '', $f->inputfieldClass); - FIX: $inputfieldClass = ((property_exists($f, 'inputfieldClass'))? str_replace('Inputfield', '', $f->inputfieldClass) : ''); For the #2: - Original code: $pageLabelField = utf8_encode($pageLabelField); - FIX: $pageLabelField = mb_convert_encoding($pageLabelField, "UTF-8", mb_detect_encoding($pageLabelField)); For the #3: - Original code: $page->template->pageLabelField = utf8_decode($pageLabelField); - FIX: $page->template->pageLabelField = mb_convert_encoding($pageLabelField, "UTF-8", mb_detect_encoding($pageLabelField)); It is possible for you to update the module so it will be fixed on the future installations? Thank you for your time
  2. @Autofahrn Yes that is one of my concerns. The first approach to the implementation of the structure was to have a parent Processwire installation and to have some other children Processwire installations that in some how will mirror the structure of the parent (templates and fields). The templates and fields were not be edited on the children only the pages. For the pages we needed other process to maintain everything synchronised. But this scenario is really difficult to maintain and synchronise and we have dismiss this approach and we are going to a central Processwire installation with an API and each child can CRUD using the API. We will need import/export functionality but with less or none uncertainties on the process since they will be executed on the central installation. Thank you
  3. @kongondo thank you for your time and for your reply. It gave me a lot of to dig into. Many thanks for the links and examples.
  4. Many thanks for you reply, I am going to check my code using your example.
  5. Hi, I have a project that will be necessary to export/import and create/update pages and fields using the API without the end user action: - It is possible to export pages or fields to a file and save that file using the Processwire API? - It is possible to import pages or fields from a local or remote file (previous exported from other Processwire) using the Processwire API? - It is possible to update pages or fields from a file using the Processwire API? - Can the export/import functionalities give any help addressing these issues or it is necessary create all these functionalities from scratch? Thank you and hoping to have your feedback.
  6. @adrian - I just updated to the last version. Thank you for your availability, all the best.
  7. Hi, I am using the Tracy Debugger 4.17.18. Regarding the @Robin S remark about the having the "Tracy debug bar disabled for modals", I had the Tracy Debug disable for modals, can this be the cause of the error?
  8. To test this possibility I have created a field InputfieldFieldset (fieldsetPage1) that have a FieldtypeFieldsetPage (fieldsetPage2) and the field2 has a FieldtypeFieldsetPage (fieldsetPage3) that has a text field (text_field) a added the fieldsetPage1 to a template (template1) like this: - template1 > fieldsetPage1 > fieldsetPage2 > fieldsetPage3 > text_field When I page a page using this template, $p = $pages->find("template=template1")->first(); , I can get the "text_field" value using the object notation link this: - $text_field_value = $p->fieldsetPage1->fieldsetPage2->fieldsetPage3->text_field; But when I try to find a page using: - $p = $pages->find("template=template1, fieldsetPage1.fieldsetPage2.fieldsetPage3.text_field=test"); I get an error: - Exception: Operator ~= not supported for fieldsetPage2.data (in /www/domain.com/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module line 1384) I am using ProcessWire 3.0.126, Do anyone have done something like this or explain what is wrong?
  9. Hi, It is possible to create a field InputfieldFieldset (fieldsetPage1) that have a FieldtypeFieldsetPage (fieldsetPage2) and the field2 has a FieldtypeFieldsetPage (fieldsetPage3) that has a text field (text_field) a added the fieldsetPage1 to a template (template1) like this and use $p = $pages->find("template=template1, fieldsetPage1.fieldsetPage2.fieldsetPage3.text_field=test"); to find pages? Thank you
  10. @Robin S, yes I had the Tracy Debugger disabled for modals, thank you for the tip.
  11. Hi, I have made a module that adds new configuration fields to all field types. One of the issues that I am struggling with is , the new configuration fields works fine when editing the field itself but on the template context the field value is not saved when changed. When saving the new value when editing the the field on the template context the wire('input')->post is empty and I do not know how to get the new value to save it on the field "value" attribute or what might be wrong with the code. In attach is the file of the module "ExtraFieldConfigurations.module". Many thanks ExtraFieldConfigurations.module
  12. Thank you, for the explanation and for the alternative. All the best
  13. Hi, even using: \TD::barDump('test'); or bd(), d(), l(), fl(), when trying to debug a field on the template context I always get the following error, in this case I was trying to use \TD::barDump('test'); I think that is because the module Tracy Debugger is not loaded when editing a field on the template context, can this be the case? Thank you
  14. Hi, I think this is a newbie question but I am trying to use Tracy Debugger to debug code on the a field in the Template context but gives me the error: - "Fatal error: Uncaught Error: Call to undefined function ProcessWire\barDump()" I tried to use: TD::barDump('test'); and $TD = $this->modules->get('TracyDebugger'); $TD::barDump('test'); but also gives an error. How can I call the barDump() on a field in the template context ? Many thanks
  15. Hi, using the "ImageExtra" example I could show a extra config field on the "InputfieldText" but I am not able to save the value of the field when saving the field. I am using the following code: <?php namespace ProcessWire; class HubExtendFieldsConfigurations extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Extend Fields Configurations Options.', 'version' => 100, 'summary' => 'This module extends the fields configurations options.', 'requires' => 'ProcessWire>=3.0.0, PHP>=5.4.4', 'singular' => true, 'autoload' => true, 'icon' => 'sliders', ); } public function init() { } public function ready() { $admin = $this->config->urls->admin; $backend = strpos($this->page->url, $admin); if (in_array($this->page->name, array('edit', 'field', 'module', 'users')) || $backend === false) { // Add more InputfieldText config fields $this->addHookAfter('InputfieldText::getConfigInputfields', $this, 'addExtraFields'); // Add more InputfieldText config fields to template context $this->addHookMethod('InputfieldText::getConfigAllowContext', $this, 'addConfigAllowContext'); } } public function addExtraFields(HookEvent $event) { if (!$event->object instanceof InputfieldText) return; /** @var InputfieldFieldset $fieldset */ $fieldset = $this->modules->get('InputfieldFieldset'); $fieldset->label = $this->_('Hub extended configurations'); $fieldset->collapsed = Inputfield::collapsedYes; $fieldset->description = $this->_('Extended field configurations.'); $fieldset->attr('name', 'hub_extended_configurations'); $fieldset->icon = 'sliders'; /** @var InputfieldText $field */ $field = $this->modules->get("InputfieldText"); $field->label = $this->_('Field version'); $field->description = $this->_('The field version.'); $field->notes = 'Global field version.'; $field->icon = 'sliders'; $field->attr('name', 'hub_extended_field_version'); $field->attr('value', $event->object->getSetting('hub_extended_field_version')); $fieldset->append($field); $event->return->children->add($fieldset); } public function addConfigAllowContext(HookEvent $event){ $allowables = ['hub_extended_configurations','hub_extended_field_version']; $event->return = array_merge($event->return, $allowables); } } It is needed to implement a hook to process and save the field value? Thank you
  16. To be more precise, I need a module that adds some extra configurations fields in all fields types, I do not want to create a new field type. I am sorry, I am a newbie and at the moment I am lost on all the steps that I need to do to implement this The research I have made in the forums I could not find a clean code example or a recipe for this. I found the module "ImageExtra" that adds extra configuration fields to the "InputfieldImage". The following code is as far I could go, but the field is not showing: <?php namespace ProcessWire; class HubExtendFieldsConfigurations extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Extend Fields Configurations Options.', 'version' => 100, 'summary' => 'This module extends the fields configurations options.', 'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4', 'singular' => true, 'autoload' => true, 'icon' => 'sliders', ); } public function init() { } public function ready() { $admin = $this->config->urls->admin; $backend = strpos($this->page->url, $admin); if (in_array($this->page->name, array('edit', 'field', 'module', 'users')) || $backend === false) { $this->addHookAfter('InputfieldText::getConfigInputfields', $this, 'addExtraFields'); } } public function addExtraFields(HookEvent $event) { if (!$event->object instanceof InputfieldText) return; /** @var InputfieldWrapper $fields */ $fields = $this->wire(new InputfieldWrapper()); /** @var InputfieldFieldset $fieldset */ $fieldset = $this->modules->get('InputfieldFieldset'); $fieldset->label = $this->_('Hub extended configurations'); $fieldset->attr('name', 'hub_extended_configurations'); $fieldset->icon = 'sliders'; /** @var InputfieldText $field */ $field = $this->modules->get("InputfieldText"); $field->label = $this->_('Field version'); $field->description = $this->_('The field version.'); $field->notes = 'Global field version.'; $field->icon = 'sliders'; $field->attr('name', 'hub_extended_field_version'); $field->attr('value', $event->object->getSetting('hub_extended_field_version')); $fieldset->append($field); $fields->append($fieldset); return $fields; } } Thank you, all the best.
  17. Hi, I want to extend the fields configuration and create a new tab to put them and also to use those configuration fields on the template context. Where can I find examples how to do this? Thank you
  18. Hi, it is possible to set the WireMailSmtp config settings at runtime and send email using different settings for each user? Thank you
  19. I tried that, <?php $map = $modules->get('MarkupGoogleMap'); echo $map->render($page, 'google_map', array('width'=>'100%','height'=>'300px', 'lat'=>38.7237628,'lng'=>-9.331723199999942,'zoom'=>17)); ?> and the map didn't show. <?php echo 'lat: '.$page->google_map->lat; echo '<br/>'; echo 'lng: '.$page->google_map->lng; ?> and the values where "0.000000". Well I will try until the map shows, thank you.
  20. Hi, I tried to pass the lat, long and the zoom in the options <?php $map = $modules->get('MarkupGoogleMap'); echo $map->render($page, 'google_map', array('width'=>'100%','height'=>'300px', 'lat'=>'38.7237628','long'=>'-9.331723199999942','zomm'=>17)); ?> but didn't do nothing.
  21. HI, the output is: string(8) "0.000000" This is how is configured: What can I do next? Thank you.
  22. Hi, I start to use the FieldtypeMapMarker for the contacts in the site: http://dev.producoesindependentes.pt/beltain_new/contactos/ but the map is not rendered, the mao it self is not shown. I did put the <script> in <head> and the code to render the map is: <?php $map = $modules->get('MarkupGoogleMap'); echo $map->render($page, 'google_map', array('width'=>'100%','height'=>'500px')); ?> I think it is a javascript issue or a google maps javascript issue but it not raise any error. How can I resolve this issue? Than you
×
×
  • Create New...