error in Renderer User

Support MB Views error in Renderer User

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #47882
    Dennis De CockDennis De Cock
    Participant

    In the file /plugins/meta-box-aio/vendor/meta-box/mb-views/src/Renderer/User.php there is an issue:

    on line 15:
    $this->data = array_merge( $this->get_fields(), $this->data );

    I get the error Uncaught TypeError: array_merge(): Argument #2 must be of type array, null given

    I fixed this with $this->data = array_merge( $this->get_fields(), $this->data ?? []);
    but can the team fix this permanently? now with every update I need to patch this again..

    tnx

    #47892
    PeterPeter
    Moderator

    Hello Dennis,

    Thanks for the feedback.

    It would be better if we could understand exactly what data is used in this case. Can you please share the code in the View editor? Or let me know how to reproduce the issue with clear steps.

    #47895
    Dennis De CockDennis De Cock
    Participant
    {% if(user.ID > 0) %}
    	{% if(user.contact_id > 0) %}
    			{% if(registered == 500 ) %}
    				text
    			{% else %}
    				{% if(registered > 0 ) %}
    					{% if(registered == 1 ) %}
    						<h4>
                                                    text
    						</h4>
    					{% else %}
    						<h4>
                                                     text
    						</h4>
    					{% endif %}
    				{% else %}
    					{% if (date(post.begindate) <= date()|date_modify("+1 day") and date(post.enddate)|date_modify("+1 day") > date()) %}
    						{% if((post_max - post.totalsub) > 0) %}
                                                             show form
    						{% else %}
                                                             show form
    						{% endif %}
    					{% endif %}
    				{% endif %}
    			{% endif %}
    	{% endif %}
    {% else %}
    		text
    {% endif %}
    
    

    if you put this in a view and show it on a form you get an error when not logged in.

    #47902
    PeterPeter
    Moderator

    Hello,

    I can reproduce the issue on my demo site with your code. I've escalated this to the development team so they can fix it in the next update of MB Views.

    Thank you.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.