Forum Replies Created

Viewing 15 replies - 1 through 15 (of 29 total)
  • Thread Starter Dennis Dallau

    (@yorlinqnl)

    I can confirm that YOOtheme has fixed the bug.

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    Tnx for your help.

    Their looking into it: https://yootheme.com/support/question/140905#answer-449935

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    Tnx.

    I have turned DEBUG on and got this message:

    Notice: Undefined variable: _FILES in /data/sites/web/yorlinqnl/www/wp-content/themes/yootheme/vendor/yootheme/http-message/src/ServerRequest.php on line 50
    
    Fatal error: Uncaught TypeError: Argument 1 passed to YOOtheme\Http\Message\UploadedFile::normalizeFiles() must be of the type array, null given, called in /data/sites/web/yorlinqnl/www/wp-content/themes/yootheme/vendor/yootheme/http-message/src/ServerRequest.php on line 50 and defined in /data/sites/web/yorlinqnl/www/wp-content/themes/yootheme/vendor/yootheme/http-message/src/UploadedFile.php:170 Stack trace: #0 /data/sites/web/yorlinqnl/www/wp-content/themes/yootheme/vendor/yootheme/http-message/src/ServerRequest.php(50): YOOtheme\Http\Message\UploadedFile::normalizeFiles() #1 /data/sites/web/yorlinqnl/www/wp-content/themes/yootheme/vendor/yootheme/container/src/Container.php(279): YOOtheme\Http\Message\ServerRequest::fromGlobals() #2 /data/sites/web/yorlinqnl/www/wp-content/themes/yootheme/vendor/yootheme/container/src/Container/Service.php(154): YOOtheme\Container->call() #3 /data/sites/web/yorlinqnl/www/wp-content/themes/yootheme/vendor/yootheme/container/src/Container.php(329): YOOtheme\Container\Service->resolveIns in /data/sites/web/yorlinqnl/www/wp-content/themes/yootheme/vendor/yootheme/http-message/src/UploadedFile.php on line 170

    So its YOOtheme that is the trigger.

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    Thanks for your reply. I’ve solved it myself in a different (maybe not 100% clean) way but it works great and I’m proud so ??

    SOLVED

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    SOLVED

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    Yeah that’s indeed a start (I was aware of) although these shortcodes actually display the whole DIV HTML stuff around it too. Even the label is rendered within this shortcode.

    There is no option to JUST render: <input....> instead of the whole surrounding DIVS aswell??

    Tnx m8

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    SOLVED

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    After weeks I’m finally there with this data-condition code. Many tnx.

    I have bought you a couple of drinks so you won’t dry out ??

    SOLVED

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    Aha… And that’s why you build this plugin and I did nott. Smart thinking ??

    In that case below code does not cut it because it always implements both field like this:

    DATE != xxx AND Field1 == 1, DATE != yyy AND Field1 == 1, DATE != zzz AND Field1 == 1

    // Apply conditions to fields
    add_filter('acf/prepare_field/name=booking_time_session_1', 'yl_check_booking_setting_exceptions_session_1');
    function yl_check_booking_setting_exceptions_session_1($field){
      $conditions = array();
      if (have_rows('booking_setting_exceptions', 'booking_settings')) {
        while (have_rows('booking_setting_exceptions', 'booking_settings')) {
          the_row();
    		if (get_sub_field('booking_setting_exceptions_session') == '1') {
            $date = date_i18n('Ymd', strtotime(get_sub_field('booking_setting_exceptions_date', 'booking_settings')));
            if (empty($date)) {
              // no date, skip this row
              continue;
            }
            // Add the condition to the field
            $conditions[] =
              array(
    			   array(
    				'field'   => 'field_5ed4181bd63dc', // Time field session 1 in the form
    				'operator'  => '==', // If Value is same, then show the field
    				'value'   => '1', // Compare against session option page value
    			  ),
    			 array(
    				'field'   => 'field_5ed4178dd63d7', // Date field in the form
    				'operator'  => '!=', // If Value is different, then show the field
    				'value'   => $date, // Compare against date option page value
    			  )
    			);
    		}
        } // end while have_rows
      } // end if have_rows
      $field['conditional_logic'] = $conditions;
      // Return
      return $field;
    }
    Thread Starter Dennis Dallau

    (@yorlinqnl)

    I did tested it in the UI, even before I posted the question here, but I found out what’s different between your setup and mine.

    You use:
    date VALUE IS EQUAL TO …..

    I use:
    date VALUE IS NOT EQUAL TO …..

    Try it and you’ll see it doesn’t work.

    So exactly the same as you tried the last time but now both DATE VALUES as NOT EQUAL TO

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    Surely I first insert the conditions via the conditional logic option of the field itself but I got the same negative result.

    Your setup is slightly different than mine….

    Try the same thing you did only than: the exact same field + value of the second field and only another date in the 1st and 2nd condition combi.

    F.i.:

    – Field1 (Text)
    – Date1 (Date)
    Field2 (Text)
    – Date2 (Date)
    – Final field (Textarea)

    (Field1 == 1 && Date1 == 20200627) OR (Field1 == 1 && Date1 == 20200628)

    That’s where it doesn’t work anymore…

    • This reply was modified 4 years, 3 months ago by Dennis Dallau.
    Thread Starter Dennis Dallau

    (@yorlinqnl)

    Yes I’m still trying and no I still haven’t found the answer.

    I have posted multiple times on the ACF forms, I even created an official ACF ticket, I posted multiple times on Stack…

    Really don’t understand why people are not willing to help me with the few lines of code but I guess that’s just the way it works ??

    My final try and then I have to quit. Not because I want, but because I have to because the final key is missing to complete the puzzle.

    What if I send you $75,- via PayPal (up front) would you then help me?

    This working code:

    // Apply conditions to fields
    add_filter('acf/prepare_field/name=booking_time_session_1', 'yl_check_booking_setting_exceptions');
    function yl_check_booking_setting_exceptions($field){
    
        if ( have_rows('booking_setting_exceptions', 'booking_settings') ) {
            while ( have_rows('booking_setting_exceptions', 'booking_settings') ) {
                the_row();
    			
    			if (get_sub_field('booking_setting_exceptions_session', 'booking_settings') == '1' ) {
    				$date = date_i18n('Ymd', strtotime(get_sub_field('booking_setting_exceptions_date', 'booking_settings')));
    
    				// Bail early if no option date found
    				if (empty($date)) {
            			return $field;
    				}
    
    				// Add the condition to the field
    				$field['conditional_logic'] = array(
    
    					array(
    
    						array(
    							'field'     => 'field_5ed4181bd63dc', // Time field session 1 in the form
    							'operator'  => '==', // If Value is different, then show the field
    							'value'     => '1', // Compare against session option page value
    						),
    
    						array(
    							'field'     => 'field_5ed4178dd63d7', // Time field session 1 in the form
    							'operator'  => '!=', // If Value is different, then show the field
    							'value'     => $date, // Compare against date option page value
    						)
    
    					)
    
    				);
    			}
    
            }
    
        }
    
        // Return
        return $field;
    
    }

    gives me this data-condition output:

    data-conditions="[[{"field":"field_5ed4181bd63dc","operator":"==","value":"1"},{"field":"field_5ed4178dd63d7","operator":"!=","value":"20200625"}]]"

    20200625 is the last date (row) of 3 rows in the repeater field.

    I simply want this part [{"field":"field_5ed4181bd63dc","operator":"==","value":"1"},{"field":"field_5ed4178dd63d7","operator":"!=","value":"20200625"}] multiple times separated with comma so all conditions will be active.

    Can I hire you this? Someone with your knowledge of ACF should fix this in no time ??

    If not… Anybody else around I can hire for this?

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    SOLVED

    Thanks! That was what I was searching for!

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    Quote: “I have an option field PAGE where you can save the success message for submitting a frontend form.”

    Sorry for the miscommunication…

    Do I understand you comment correctly that field values of an option page can’t be processed within your SUCCESS MESSAGE form option field?

    Thread Starter Dennis Dallau

    (@yorlinqnl)

    I’m getting pretty frustrated here… Nomather what I change in the code…. It will always output only 1 condition.

    f.i.: data-conditions="[{"field":"field_5ed4181bd63dc","operator":"==","value":"1"},{"field":"field_5ed4178dd63d7","operator":"!=","value":"20200627"}]" even though I have set 2 x date + session (in the repeater field) as conditions.

    // Apply conditions to fields
    add_filter('acf/prepare_field/name=bookings_field_time_session_1', 'yl_check_booking_exeptions_session_1');
    function yl_check_booking_exeptions_session_1( $field ) {
    
    	$rows = get_field('bookings_settings_disabled_exceptions', 'bookings');
    
        // Retrieve option values. Date value should be like: 20200611 (unformatted)
    	if ($rows) {
    
    		foreach($rows as $row) {
    
    			$option_date = $row['bookings_settings_disabled_date'];
    			$date = date_i18n('Ymd', strtotime($option_date));
    			$session = $row['bookings_settings_disabled_session'];
    
    			// Add the condition to the field
    			$field['conditional_logic'] = array(
    
    				array(
    					'field'     => 'field_5ed4181bd63dc', // Time field session 1 in the form
    					'operator'  => '==', // If Value is different, then show the field
    					'value'     => $session, // Compare against option page value
    				),
    
    				array(
    					'field'     => 'field_5ed4178dd63d7', // Datepicker fiels in the form
    					'operator'  => '!=', // If Value is different, then show the field
    					'value'     => $date, // Compare against option page value
    				)
    
    			);
    
    		}
    
    		// Return
    		return $field;
    
    	}
    
    }

    HEEEEEEELLLLPPPPPP I’m too close to let go now ??

Viewing 15 replies - 1 through 15 (of 29 total)