How do I save a Google Form?

I created a registration form on a Google Form and emailed it to be filled out. Now I want to save the form and the answers to the questions. How do I do that?

8 – How would I create and render, but not save, an entire menu tree programmatically?

I’m trying to pull a number of links from several services, and combine them into a renderable menu tree:

Source one: pull links A, B and C

Source two: pull links D and E

Source three: pull links F, G, and H

Desired end result: a menu tree object that I can render using core and contrib menu theming functions, structured like:

  • Parent 1
  • Parent 2
  • Parent 3

It seems like this is simple enough to do with a menu that’s been saved to the database, but as the contents of the links from each of these sources may change at any time, I’m looking to build the menu on the fly. I can create menu items out of the data, but I’m having trouble creating and populating a tree with them. All the documentation and posts I’ve been able to find seem to assume you’re loading a tree from a pre-existing menu. I think what I need to do is create a new, empty tree, and add the links to it. Is there a way to do this?

HostRound LLC – 2x E5-2637 v2 3.50GHz | 64GB RAM | 2x 1TB SSD + 4TB HDD | 1 Gbps / 50TB – SAVE $100 | NewProxyLists

USA Dedicated Server Locations: Dallas, TX, Los Angeles, CA & New York City
EU Dedicated Server Locations: Netherlands

Uplink: 100Mbps,1Gbps & 10Gbps
Traffic: 50TB, 100TB and Unmetered

Operating Systems: CentOS, Ubuntu, Debian, FreeBSD, CloudLinux, VMWare, Windows Server 16 & 2019

Control Panels: cPanel/WHM, DirectAdmin, CentOS Web Panel and Plesk

Server management: $55/m for a cPanel server , otherwise ($89/m) (limited time offer)

Why Hostround Dedicated Server Hosting?
– Multiple locations across the USA and Europe (All Tier-III+ Data Centers)
– Servers built on the latest technology and most efficient hardware.
– Multiple Tier-1 Carriers
– Power and Network Redundancy, Low-latency network and Connectivity Failover
– Fast support provided by experts available 24/7.
– Free basic DDoS mitigation up to 10Gbps and Enterprise protection up to 500Gbps.
– Discounted management fee on cPanel servers.
– A wide range of Operating systems and control panels.
– Amazing Uptime of 100%
– Ability to manage and monitor your server in all location from One Portal
– Unlimited reboots / OS Reloads
– Dedicated port speed (up to 10Gbps)
– IPv6 Support

!! HOT OFFER !!
Order this month and get 500Gbps Low-latency DDoS protection for FREE!!

CPU 2x E5-2637 v2 @ 3.50GHz 8C/16T
RAM 64GB
2 x 1TB SSD (HW RAID 1)
1 x 4TB HDD
1 Gbps Uplink (50TB Traffic)
1 IPv4 (Upgradable)
Free IPv6
Dallas, TX
Price: $149.99 USD /mo (Use coupon 37V2SPECIAL)
Order Now and SAVE $100

!!NEW ARRIVALS!!
Order this month and get 500Gbps Low-latency DDoS protection for FREE!!

Intel Xeon E-2276G (3.8 – 4.9GHz/12M Cache) (6 Cores/12 Threads)
RAM 32GB DDR4 2666MHz
Storage 1TB Samsung NVMe SSD + 4TB HDD
1 Gbps / 100TB Traffic
5Gbps free DDoS Protection (Free 500Gbps DDoS protection included when ordered this month)
Locations: Dallas, TX
Price: $129.99 /month *Limited time price
Order Now

Intel Xeon E-2276G (3.8 – 4.9GHz/12M Cache) (6 Cores/12 Threads)
RAM 32GB DDR4 2666MHz
Storage 2x 1TB SSD + 4TB HDD
1 Gbps / 100TB Traffic
5Gbps free DDoS Protection (Free 500Gbps DDoS protection included when ordered this month)
Locations: Dallas, TX
Setup fee: $20
Price: $157.99 /month *Limited time price
Order Now

Intel Xeon E-2234 (3.6-4.8GHz/8M Cache) (4 Cores/ 8 Threads)
RAM 32GB DDR4 2666MHz
Storage 500GB NVMe SSD
1 Gbps / 100TB Traffic
5Gbps free DDoS Protection (Upgradable)
Locations: New York City
Price: $139.99 /month
Order Now

* Full Management plan is $55/m for cPanel servers

——————-
United States
——————-

Intel Xeon E3-1270 V2
RAM 8GB DDR3 (Upgradable)
Storage 500GB HDD (SSD Available)
100Mbps Connection speed (Upgradable)
50TB Traffic
5Gbps Free DDoS Protection (Upgradable)
Location: Dallas, TX USA
Price: $65.99 /month
Customize & Order

Intel Xeon E3-1230
RAM 16GB DDR3
Storage 2x 4TB HDD
1Gbps / Unmetered Traffic
5Gbps free DDoS Protection (Upgradable)
Locations: Dallas, New York, Los Angeles
Price: $119.99 /month
Order Now

Intel Xeon E3-1270 v3
RAM 32GB DDR3
Storage 2 x 256GB SSD
1 Gbps / 100TB Traffic
5Gbps free DDoS Protection (Upgradable)
Locations: Los Angeles, CA & Dallas, TX
Price: $134.99 /month
Order Now

Intel Xeon E-2234 (3.6-4.8GHz/8M Cache)
RAM 32GB DDR4 2666MHz
Storage 500GB NVMe SSD
1 Gbps / 100TB Traffic
5Gbps free DDoS Protection (Upgradable)
Locations: New York City
Price: $139.99 /month
Order Now

Intel Xeon E-2134 (3.5GHz/8M Cache)
RAM 32GB DDR4
Storage 500GB SSD
1 Gbps / 100TB Traffic
5Gbps free DDoS Protection (Upgradable)
Locations: Dallas, Los Angeles
Price: $159.99 /month
Order Now

SPECIAL!!
2x Intel Xeon E5-2637 V2 (3.5 GHz / 15M Cache)
RAM 64GB DDR3
Storage 2x 500GB SSD + 4TB HDD (Upgradable)
1 Gbps / 50TB Traffic (Upgradable)
5Gbps free DDoS Protection (Upgradable)
Locations: Dallas, TX
Price: $249.99 /month
Customize & Order

——————————-
Netherlands
——————————-

Intel Xeon E3-1270 V2
RAM 8GB DDR3
Storage 500GB HDD (SSD Available)
100Mbps Connection speed (Upgradable)
50TB Traffic
10Gbps Free DDoS Protection (Upgradable)
Location: Netherlands
Price: $65.99 /month
Customize & Order Now

Intel Xeon E3-1230 V6
RAM 16GB DDR4
Storage 1TB HDD (SSD Available)
1Gbps Connection speed (Upgradable)
50TB Traffic
40Gbps Free DDoS Protection (Upgradable)
Location: Netherlands
Price: $79.99 /month
Customize & Order

Intel Xeon E-2234 (3.6-4.8 GHz/8M Cache)
RAM 8GB DDR4
Storage 1TB HDD
1 Gbps / 50TB Traffic
40Gbps free DDoS Protection (Upgradable)
Locations: Netherlands
Price: 89.99 /month
Order Now

!! SPECIAL OFFER !!
2x Intel Xeon E5-2620 V4
32GB DDR4 RAM (Upgradable)
1TB HDD (SSD Available)
1Gbps Connection speed (Upgradable)
50TB Traffic
40 Gbps Free DDoS Protection (Upgradable)
Location: Netherlands
Price: $174.99 /month
Customize & Order

================================
Unmetered Traffic in Netherlands
================================

Intel Xeon E3-1230 V6 3.5GHz / 8M Cache
RAM 16GB DDR4 (Upgradable)
Storage 1TB HDD (Upgradable)
1 Gbps Connection speed (Dedicated) (Upgradable to 10Gbps)
Unmetered Traffic
40 Gbps Free DDoS Protection (Upgradable)
Location: Netherlands
Price: $199.99 /month
Order Now

cPanel server management cost $55/m (Limited time offer)

——-
All Servers are managed from one panel.
——-

——-
Questions?
Call us +1(888)-991-1272
Talk to us on Live Chat
Open a ticket
check our Knowledge base
——-

Dedicated Server Hosting – Dedicated Server Netherlands – US Dedicated Server – 100TB Servers – Managed Dedicated Servers – Unmetered Servers

HostRound Blog

Follow us on Facebook – Twitter
Support is Available 24/7.

We accept: Credit cards (Visa, Master, Amex, Diners, JCB, Discover), PayPal, AliPay, Bitcoin & Bitcoin Cash

8 – Drush script to save multiple nodes of different types

I wrote a function that updates fields of an “Intervention” content type and saves it, then saves the “Request” node that contains it, and then saves the “Dossier” node that contains that request.

Running that code in a Devel PHP form work fine.

Now I’m trying to convert that function into a drush script that I could schedule to run everyday. But running that script gives me a couple of errors that I don’t understand.

In Renderer.php line 243:

(LogicException)
Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use renderPla
in()/renderRoot() or #lazy_builder/#pre_render instead.

In SqlContentEntityStorage.php line 846:

(DrupalCoreEntityEntityStorageException)
Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use renderPla
in()/renderRoot() or #lazy_builder/#pre_render instead.

Looking at the stack trace, it looks like a save() call on an entity is triggering these errors … does anybody know what needs to be done to correct them?

Thank you!

Function code … comments are in french, sorry

$query = Drupal::entityQuery('node')
->condition('type', 'intervention')
->condition('field_type_intervention', '318')
->sort('changed', 'ASC');

$nids = $query->execute();
$node_storage = Drupal::entityTypeManager()->getStorage('node');
$nodes = $node_storage->loadMultiple($nids);
$i = 0;

// pour tous ces hébergements
foreach ($nodes as $n) {
  echo $n->title->value . "<br>";

  $dateDebutVal = $n->field_date_debut_intervention_1->value;
  $dateFinVal = $n->field_date_fin_intervention_1->value;

  $nbChambres = $n->field_nombre_chambres->value;
  $tarifNuitee = $n->field_tarif_nuitee->value;

  echo  'dateDebut='.$dateDebutVal. '<br>';
  echo  'dateFin='.$dateFinVal. '<br>';
  $dateDebut = strtotime($dateDebutVal);

  if ($dateFinVal != "") {
    $dateFin = strtotime($dateFinVal);
  }
  else {
    $dateFin = time();
  }

  $datediff = $dateFin - $dateDebut;
  $nbJours = floor($datediff / (60 * 60 * 24));

  if ($nbJours == 0) {
    $nbJours++;
  }

  echo 'nbJours = '.$nbJours. '<br>';
  $n->set('field_nombre_nuitee', $nbJours);

  // si le nombre de chambre et le tarif nuitée sont settés, calculer le montant estimé
  if ($nbChambres != "" && $tarifNuitee != "") {
    echo 'estimation = '.number_format($tarifNuitee * $nbChambres * $nbJours, 2, '.', ''). '<br>';
    $n->set('field_cout_estime', number_format($tarifNuitee * $nbChambres * $nbJours, 2, '.', ''));
  }

  // sauvegarder l'hébergement
  $n->save();

  // aller chercher la requête de cet hébergement et la sauvegarder
  $queryRequete = Drupal::entityQuery('node')
    ->condition('type', 'requete')
    ->condition('field_intervention_service', $n->id())
    ->sort('changed', 'ASC');

  $nidsRequete = $queryRequete->execute();
  $requetes = $node_storage->loadMultiple($nidsRequete);

  foreach ($requetes as $r) {
    echo $r->title->value . '<br>';
    $r->save();

    $queryDossier = Drupal::entityQuery('node')
      ->condition('type', 'dossier')
      ->condition('field_requete_menage', $r->id())
      ->sort('changed', 'ASC');

    $nidsDossier = $queryDossier->execute();
    $dossiers = $node_storage->loadMultiple($nidsDossier);

    foreach ($dossiers as $d) {
      echo $d->title->value . '<br>';
      $d->save();
    }
  }

  // aller chercher le dossier lié à cette requête et le sauvegarder
  $i++;
}

echo 'i = '.$i. '<br>';

Stack trace for LogicException

Exception trace:
at C:xampphtdocsgosrcorelibDrupalCoreRenderRenderer.php:243
DrupalCoreRenderRenderer->doRender() at C:xampphtdocsgosrcorelibDrupalCoreRenderRenderer.php:200
DrupalCoreRenderRenderer->render() at C:xampphtdocsgosrmodulescontribserialsrcPluginFieldFieldFormatterSerialDefaultFormatter.php:33
DrupalserialPluginFieldFieldFormatterSerialDefaultFormatter->viewElements() at C:xampphtdocsgosrcorelibDrupalCoreFieldFormatterBase.php:89
DrupalCoreFieldFormatterBase->view() at C:xampphtdocsgosrcorelibDrupalCoreEntityEntityEntityViewDisplay.php:263
DrupalCoreEntityEntityEntityViewDisplay->buildMultiple() at C:xampphtdocsgosrcorelibDrupalCoreEntityEntityEntityViewDisplay.php:221
DrupalCoreEntityEntityEntityViewDisplay->build() at C:xampphtdocsgosrcorelibDrupalCoreEntityEntityViewBuilder.php:472
DrupalCoreEntityEntityViewBuilder->viewField() at C:xampphtdocsgosrcorelibDrupalCoreFieldFieldItemList.php:243
DrupalCoreFieldFieldItemList->view() at C:xampphtdocsgosrmodulescontribtokentoken.tokens.inc:1630
field_tokens() at n/a:n/a
call_user_func_array() at C:xampphtdocsgosrcorelibDrupalCoreExtensionModuleHandler.php:403
DrupalCoreExtensionModuleHandler->invokeAll() at C:xampphtdocsgosrcorelibDrupalCoreUtilityToken.php:304
DrupalCoreUtilityToken->generate() at C:xampphtdocsgosrmodulescontribtokentoken.tokens.inc:937
token_tokens() at n/a:n/a
call_user_func_array() at C:xampphtdocsgosrcorelibDrupalCoreExtensionModuleHandler.php:403
DrupalCoreExtensionModuleHandler->invokeAll() at C:xampphtdocsgosrcorelibDrupalCoreUtilityToken.php:304
DrupalCoreUtilityToken->generate() at C:xampphtdocsgosrcorelibDrupalCoreUtilityToken.php:196
DrupalCoreUtilityToken->replace() at C:xampphtdocsgosrmodulescontribauto_entitylabelsrcAutoEntityLabelManager.php:264
Drupalauto_entitylabelAutoEntityLabelManager->generateLabel() at C:xampphtdocsgosrmodulescontribauto_entitylabelsrcAutoEntityLabelManager.php:145
Drupalauto_entitylabelAutoEntityLabelManager->setLabel() at C:xampphtdocsgosrmodulescontribauto_entitylabelauto_entitylabel.module:170
auto_entitylabel_entity_presave() at n/a:n/a
call_user_func_array() at C:xampphtdocsgosrcorelibDrupalCoreExtensionModuleHandler.php:403
DrupalCoreExtensionModuleHandler->invokeAll() at C:xampphtdocsgosrcorelibDrupalCoreEntityEntityStorageBase.php:206
DrupalCoreEntityEntityStorageBase->invokeHook() at C:xampphtdocsgosrcorelibDrupalCoreEntityContentEntityStorageBase.php:843
DrupalCoreEntityContentEntityStorageBase->invokeHook() at C:xampphtdocsgosrcorelibDrupalCoreEntityEntityStorageBase.php:500
DrupalCoreEntityEntityStorageBase->doPreSave() at C:xampphtdocsgosrcorelibDrupalCoreEntityContentEntityStorageBase.php:700
DrupalCoreEntityContentEntityStorageBase->doPreSave() at C:xampphtdocsgosrcorelibDrupalCoreEntityEntityStorageBase.php:454
DrupalCoreEntityEntityStorageBase->save() at C:xampphtdocsgosrcorelibDrupalCoreEntitySqlSqlContentEntityStorage.php:837
DrupalCoreEntitySqlSqlContentEntityStorage->save() at C:xampphtdocsgosrcorelibDrupalCoreEntityEntityBase.php:395
DrupalCoreEntityEntityBase->save() at C:xampphtdocsgosrmodulescustomgosr_modscript_update_nb_nuitees.php:75
include() at C:xampphtdocsgosrvendordrushdrushsrcCommandscorePhpCommands.php:111
DrushCommandscorePhpCommands->script() at n/a:n/a
call_user_func_array() at C:xampphtdocsgosrvendorconsolidationannotated-commandsrcCommandProcessor.php:257
ConsolidationAnnotatedCommandCommandProcessor->runCommandCallback() at C:xampphtdocsgosrvendorconsolidationannotated-commandsrcCommandProcessor.php:212
ConsolidationAnnotatedCommandCommandProcessor->validateRunAndAlter() at C:xampphtdocsgosrvendorconsolidationannotated-commandsrcCommandProcessor.php:176
ConsolidationAnnotatedCommandCommandProcessor->process() at C:xampphtdocsgosrvendorconsolidationannotated-commandsrcAnnotatedCommand.php:302
ConsolidationAnnotatedCommandAnnotatedCommand->execute() at C:xampphtdocsgosrvendorsymfonyconsoleCommandCommand.php:255
SymfonyComponentConsoleCommandCommand->run() at C:xampphtdocsgosrvendorsymfonyconsoleApplication.php:1005
SymfonyComponentConsoleApplication->doRunCommand() at C:xampphtdocsgosrvendorsymfonyconsoleApplication.php:255
SymfonyComponentConsoleApplication->doRun() at C:xampphtdocsgosrvendorsymfonyconsoleApplication.php:148
SymfonyComponentConsoleApplication->run() at C:xampphtdocsgosrvendordrushdrushsrcRuntimeRuntime.php:118
DrushRuntimeRuntime->doRun() at C:xampphtdocsgosrvendordrushdrushsrcRuntimeRuntime.php:49
DrushRuntimeRuntime->run() at C:xampphtdocsgosrvendordrushdrushdrush.php:72
require() at C:xampphtdocsgosrvendordrushdrushdrush:4

Stack trace for EntityStorageException

Exception trace:
at C:xampphtdocsgosrcorelibDrupalCoreEntitySqlSqlContentEntityStorage.php:846
DrupalCoreEntitySqlSqlContentEntityStorage->save() at C:xampphtdocsgosrcorelibDrupalCoreEntityEntityBase.php:395
DrupalCoreEntityEntityBase->save() at C:xampphtdocsgosrmodulescustomgosr_modscript_update_nb_nuitees.php:75
include() at C:xampphtdocsgosrvendordrushdrushsrcCommandscorePhpCommands.php:111
DrushCommandscorePhpCommands->script() at n/a:n/a
call_user_func_array() at C:xampphtdocsgosrvendorconsolidationannotated-commandsrcCommandProcessor.php:257
ConsolidationAnnotatedCommandCommandProcessor->runCommandCallback() at C:xampphtdocsgosrvendorconsolidationannotated-commandsrcCommandProcessor.php:212
ConsolidationAnnotatedCommandCommandProcessor->validateRunAndAlter() at C:xampphtdocsgosrvendorconsolidationannotated-commandsrcCommandProcessor.php:176
ConsolidationAnnotatedCommandCommandProcessor->process() at C:xampphtdocsgosrvendorconsolidationannotated-commandsrcAnnotatedCommand.php:302
ConsolidationAnnotatedCommandAnnotatedCommand->execute() at C:xampphtdocsgosrvendorsymfonyconsoleCommandCommand.php:255
SymfonyComponentConsoleCommandCommand->run() at C:xampphtdocsgosrvendorsymfonyconsoleApplication.php:1005
SymfonyComponentConsoleApplication->doRunCommand() at C:xampphtdocsgosrvendorsymfonyconsoleApplication.php:255
SymfonyComponentConsoleApplication->doRun() at C:xampphtdocsgosrvendorsymfonyconsoleApplication.php:148
SymfonyComponentConsoleApplication->run() at C:xampphtdocsgosrvendordrushdrushsrcRuntimeRuntime.php:118
DrushRuntimeRuntime->doRun() at C:xampphtdocsgosrvendordrushdrushsrcRuntimeRuntime.php:49
DrushRuntimeRuntime->run() at C:xampphtdocsgosrvendordrushdrushdrush.php:72
require() at C:xampphtdocsgosrvendordrushdrushdrush:4

posts – how to save data of a new field in WCFM store manager

I added a new number field in store-manager WCFM in the product manager, and now I want to save the value of that field and for that I used the function save_add_product_meta, but it doesn’t work…
please if somebody can help me with that I will be so greatful

add_action ( ‘after_wcfm_products_manage_pricing_fields’ ,’add_new_field’ ),20 );.
function add_new_field(){

                  global $WCFM  ;
                $WCFM->wcfm_fields->wcfm_generate_form_field( array("minimumOrderQuantityFM" => array(
                        'label' => __( 'Minimum order quantity', 'wc-frontend-manager') , 
                        'name' => 'minimumOrderQuantity', 
                        'type' => 'number', 
                        'class' => 'wcfm-text wcfm_ele simple variable external grouped booking', 
                        'label_class' => 'wcfm_title', 
                     ) ));

add_action ( ‘after_wcfm_products_manage_meta_save’ ,’save_add_product_meta’,10,2 ) ;
function save_add_product_meta($post_id, $wcfm_products_manage_form_data ){

        $wcfm_moq =! empty( $wcfm_products_manage_form_data('minimumOrderQuantityFM') ) ? 'yes' : 'no';
        update_post_meta($post_id, 'minimumOrderQuantityFM', $wcfm_moq  );
    
    }

plugins – Save shortcodes attributes and use them via AJAX

I am trying to develop a shortcode to show people’s phone numbere. I developed a shortcode and pass attributes like these:

(show-phone-number name="person1" phone1="111111111" phone2="22222222")
(show-phone-number name="person2" phone1="666666666" phone2="99999999")
(show-phone-number name="person3" phone1="444444444" phone2="55555555")

We want to use it with a dynamic number of shortcodes for different persons (not a fixed number of persons) and show half of their number before the visitor clicks on a specific button. So, for the first shortcode, firstly, we show:

name: person1 
phone number 1: 1111**** 
phone number 2: 2222****
(click to see full number)

Whenever the user clicks on the button ‘click to see the full number’, I want to show the full phone number of the person via AJAX.

The problem is, I don’t know how to save each shortcode attribute and give each shortcode an ID to use its data via AJAX and render AJAX response (full phone number).

I tried this:

public function register_shortcodes() {

        add_shortcode( 'show-phone-number', array( $this, 'main_shortcode' ) );

    }

    public function main_shortcode( $atts, $content = null ) {
        global $post;

        $output = "";        

        static $index = 0;

        $id = $atts('id') = uniqid();

        $output .= "<div class='person-details' data-person='" . $id . "'>";

        $content = trim( $content );

        $output .= $this->person_phone_shortcode( $id , $atts );

        add_post_meta($post->ID, 'show-phone-number' . $index, , false);

        ob_start();
        ?>
            <button class="show-person-details">(click to see full number)</button>
        </div>
<?php
        $index++;
        return $output . ob_get_clean();
    }
public function person_phone_shortcode( $id, $atts ) {

        $output = "";

        $validKey = "phone";
        $validKeyLength = strlen( $validKey );

        foreach ( $atts as $key => $phoneNumber ) {

            if ( substr($key, 0, $validKeyLength) === $validKey ) { 

                $output .= self::hideHalfOfText( $phoneNumber ) . " </br>";

            }

        }

        return $output;
    }
public function hideHalfOfText( $text ) {

        if ( strlen( $text ) < 2 ) {
            return $text;
        }

        $halfLength = (int)( strlen( $text ) / 2 );

        $hideCharacter = '*';

        $halfOfOriginalText = substr( $text, 0, $halfLength );

        $output = $halfOfOriginalText;

        for ($i = 0; $i < $halfLength; $i++) {
                $output .= $hideCharacter;
        }

        return $output;

    }

AJAX/jQUERY:

    $('body').on('click', '.show-person-details', function(e) {
                        e.preventDefault();

                        var $button = $(this),
                        $personWrapper = $button.closest('.person-details'),
                        $personId = $personWrapper.data('person'),
                        data = {
                            action: "show_person_ajax",
                            security: public.security,
                            personId: $personId,
                        };

                        $.ajax({
                            url: public.url,
                            method: "POST",
                            data: data,
                            success: function( response ) {
                                console.log( response )
                            },
                            error: function( response ) {
                                console.log( response )
                            }
                        });

                } );
    public function show_person_ajax() {

        check_ajax_referer( 'show_person_nonce', 'security' );

        if ( ! isset( $_POST('personId') ) || empty( $_POST('personId') ) ) {
            wp_send_json_error( ( message => "error" ) );
        }
        $personId = sanitize_text_field( $_POST('personId') );

        
        wp_send_json_success( ( message => (I WANT THE PERSON's ID HERE TO GET THEIR PHONE NUMBER AND NAMES) ) );

    }

Trouble with spellcasting classes and their save DCs in Pathfinder

So I’ve played a caster in several Pathfinder games with my friends over the years, but I’ve continued to have the same problem with a lot of them. Namely, because of how save DCs work and how a lot of creatures are stated, it often feels pointless to use most spells on my list because FORT and WILL mods are always so high that I’d have to hope for 1 on the die half of the time. Even DEX saves can be remarkably high on an enemy’s side so my only recourse is touch attacks or spells without DCs and even then I’ve dumped everything into my casting stat to even hope to make my save DC high enough to force a spell through.

The system is very content-dense, but so far I’ve only managed to find some small buffs like Spell Focus feats to bump up DCs. I think Arcanists have some exploits that can help too but I am currently playing a witch and my options feel rather limited. But it seems like there must be other options out there since so many people swear by casters’ abilities and I know that to be true of this system and others, especially as I’ve seen other friends power game other builds. In particular, my friend’s (current GM) previous oracle build was untouchably powerful. Is there just something that I am missing to make my caster viable? Able to land a spell on a creature with decent saves?

xml – Is there a way to save MS Word document as HTML w/o the ms proprietary stuff?

So normally I wouldn’t use this feature (“Save as Web Page”) but I have large documents from clients they just want put on their site as HTML, and formatting it all by hand seems like a waste of time.

I have tried “save as webpage” in Word 2007, but it produces all sorts of bad stuff. To wit:

<b style='mso-bidi-font-weight:normal'>
<span style="mso-spacerun: yes">

as well as a large block of XML formatting info:

<!--(if gte mso 9)><xml>
 <o:DocumentProperties>
 <o:Subject> </o:Subject>
 <o:Author> </o:Author>
 <o:Keywords> </o:Keywords>
 ...

As I said, formatting it all by hand seems like a waste of time, but the way MS exports currently just has too much cruft. Is there a way to export MS Word doc as html without all this?

EDIT: This document is a charter/bylaws type document and therefor has many levels of nested list. One of my criteria for “success” in this conversion endeavor is that the list hierarchy is retained, not discarded.

java – What is the better way to save swagger code gen plugin generated model classes in spring boot maven application?

So, I am working on a spring boot maven project in Eclipse IDE. And here is my pom.xml.


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>spring-swagger-codegen-api-client</artifactId>
    <name>spring-swagger-codegen-api-client</name>
    <packaging>jar</packaging>
    <url>https://github.com/swagger-api/swagger-codegen</url>
    <description>Swagger Java</description>
...
...ommited for brevity
...

    <build>
        <plugins>

<plugin>
    <groupId>io.swagger</groupId>
    <artifactId>swagger-codegen-maven-plugin</artifactId>
    <version>2.3.1</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <inputSpec>${project.basedir}/src/main/resources/customer-data-v2.json</inputSpec>
                <language>java</language>
                <configOptions>
                   <sourceFolder>swagger</sourceFolder>
                </configOptions>
            </configuration>
        </execution>
    </executions>
</plugin>
        </plugins>
    </build>

</project>

So when I compile the project using mvn compile it executes swagger code gen plugin and outputs all the generated classes to swagger folder under target folder.

And I am using swagger code gen plugin to generate all the model classes using the customer json schema which it currently outputs to swagger sub folder under target folder.

So I know that I can keep all the generated classes under target folder itself as maven executes swagger plugin before compiling the actual source code. So right now there is no issue with it.

But all the generated classes are Model classes which are used for processing request and response data. So currently there is no issue in doing so, but in future we might add additional functionality which might require updates to generated model classes and may be difficult to update them from target folder.

So my main question is should I move all the generated pojo classes to something like src/main/org/**/* folder or keep the model classes inside target folder itself? What is the better approach including other alternative?

Can I print the Print Date or Save Date in Google Documents?

Yes, it is possible. However, it is not something that is really possible utilizing the existing API. Really the lack of fields and the associated capabilities like in Word is a major disability for document automation.

Something like this will insert a footer on document open and reopen, but it is ultimately not a good solution.

function onOpen() {
    var time = new Date();
    time = Utilities.formatDate(time, "GMT", "yyyy-MM-dd'T'HH:mm:ss'Z'");
    var doc = DocumentApp.getActiveDocument();
    var s;

    if (!doc.getFooter()) {
        var footer = doc.addFooter();
        var footerText = footer.appendParagrap(time);
    } else {
        var footer = doc.getFooter();
        var footerElements = footer.getNumChildren();
        var para = footer.getParagraphs();
        s = para(footerElements-1).getText();
        var footerText = footer.replaceText(s , time);
    }
};

EDIT: How to add the script.

This code as I have presented above really should be in its own function called from the OnOpen() function rather than in there wholesale, but all good for example purposes.

If you go the Tools menu of an open document then down to Script Manager, when it loads check that it is currently empty, if has a records there, you are on your own for placement of the code.

Close the script manager, back to the Tools Menu and select Script Editor. Now if you had nothing in your script manager, select all the code and delete it. You can then paste in the code provided above and then save it.

Close the document and re-open and you should find there is now a Time Date in the footer. It should update on every open of the document, nothing fancy but will get you going.

Now for those of you who have code already associated with your document. Adding the code above minus the first and last lines into the onOpen() function will also work, but it may not due to code already present conflicting.

Hope this gets you going.